-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Home Assistant MQTT Auto Discovery #548
Comments
I also wouldn't mind being assigned to this as it's something I've been actively tooling around with |
Sounds interesting. I have started setting up my own home sensor network, but I have not made it to Home Assistant yet. I am interested to see what you come up with. |
I've managed to set up MQTT dashboard on Android and I will be integrating this into my edition of Home Assistant. Happy to help with testing, if this is of use. |
Thanks for the offer, I'll be sure to update here when I've got something worthy of testing with. Been slow going as I had to redesign my camera weatherproofing after a seriously heavy rain storm took it out last month. Finally got it back up and running so hopefully I'll have proof of concept soonish. |
Add me as another who'd be willing to help with this. I just started tinkering around with how to make it happen, then realized I should check the issues list. :D |
I too am keen on this one! indi-allsky is publishing fine to mosquito mqtt but doesn't get 'discovered' in a working mqtt to homeassistnat integration. Anything you can advise? |
That link is very helpful. Edit: I also see the same link was in the original post, too. |
Merged #1096 with a script to deploy the auto discovery topics for Home Assistant. This is my first pass at this. I have done basic validation that this works in a VM lab, but I do not currently have any of my systems online to test some of the SBC temperature data. I am not comfortable with putting the auto discovery stuff in the core code, so it is just a separate script for now. The script only takes a few seconds to run, and you should be all set. You should only need to run this once.
|
I'll try and give that a test run, Aaron. It would, however, be good to have the values autodiscovered. |
Hmm. Had this error cropping up when running setup.sh after updating from git: **** Backup DB prior to migration **** After the traceback I got this: Error: No such command 'db'. |
This has been happening to a few people. Try upgrading the following module:
If that does not fix it, just upgrade all of your modules.
|
The first suggestion acheived the following:
but didn't fix it. The second option upgraded to
and this did the trick. I hope the list of updated modules helps. |
I am starting to suspect it is not any specific module causing this, just the action of upgrading of some of these modules fixes the problem. |
Find the MQTT integration and click on the vertical ellipsis |
I tried several reloads and script reruns, what HomeAssistant and MQTT versions are you running? It shows up in MQTT, just not seen in HA |
I have tested the latest version from docker. Can you verify your base discovery topic is |
Any ideas on doing an animation other than publishing to external site? |
Other than Grafana I'd love to see sqm on a chart but it might need stat tracking - https://www.home-assistant.io/more-info/statistics/ |
The SQM value is published to MQTT and should be a data point in home assistant. Once its there, it does graph the value. You may want to re-run the auto discovery script again. By the way, you can add the indi-allsky data to Grafana. There is a JSON file generated in |
I've not tried playing with the auto-discovery yet. That's for when I get a moment to myself (whoever said that you're not busy when you retire got things very, very wrong ... ) |
I tried what @vastmeridian suggested and it messed up the rest of my MQTT integrations and now I can't get the image to re'render! :( |
I may need to integrate the auto-discovery publishing into the main program so that it is registered every time indi-allsky starts. |
Sorry about that. I don't pull the image into HA. I only use the text/numerical entities. Have you tried image MQTT? |
Nevermind what I said before about publishing. My mosquitto docker container did not have persistence configured. I have corrected my mosquitto docker config (rebuild your container if you are using this). #1104 The picture of the data above is a little different from what I see in my lab instance of home assistant. The image and data values are all automatically populated on the overview page. There are no gaps between the data values like in your screenshot. You should not have to manually configure anything other than the MQTT integration for all of these values to automatically populate. |
Presumably you're setting indi-allsky to have the homeassistant/ base topic so it can be autodiscovered? |
Not exactly. The way the auto-discovery works is the |
Ah. OK. I'll try that, but as I said above, time is short at the moment. For what I need the manual edit is just fine (as I have other entities from different systems defined similarly, so incorporating autodiscover would need a systematic edit of a number of platforms). |
This should help with the definitions: |
If you use a different autodiscovery topic in Home Assistant, you can change that in the class HADiscovery(object):
discovery_base_topic = 'homeassistant'
unique_id_base = '001' |
I'm still confused on the sensor config for the stat graph?! https://developers.home-assistant.io/docs/core/entity/sensor/#long-term-statistics All of this works however, no long term istiry is avail in the drop down for statistics graph
EDIT:
Nets me a blank graph via this yaml |
I've only just started playing with statistics so I'm equally puzzled. I'll play a bit with the definitions and see how I get on. Building this into the autodiscovered entities may prove more of a challenge. |
Success, I think... Code (from Lovelace UI)
You might want to play with the |
This is the stuff, perfect, thanks!!! |
How do I run the script? I get this: |
@ispybadguys you just need to activate the virtualenv before running the script.
|
Proposal
Home Assistant's MQTT listener can auto create devices and sensors for topics published on MQTT by having a device publish the appropriate JSON(s). I've hacked this a bit on my camera to create a camera instance on my home assistant. By publishing
{ "name": "AllSky Camera", "unique_id": "allskycam", "topic": "indi-allsky/latest" }
to the topic/homeassistant/camera/AllSkyCam/config
. However this is pretty hacky and I'd like to improve on it and define the other fields as sensors in HA.Resources
https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery
The text was updated successfully, but these errors were encountered: