Skip to content
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

Publish Home Assistant auto-discovery sensors #7

Open
That-Dude opened this issue Aug 14, 2022 · 4 comments
Open

Publish Home Assistant auto-discovery sensors #7

That-Dude opened this issue Aug 14, 2022 · 4 comments

Comments

@That-Dude
Copy link

First of all I just want to say thank you for this project. I've got it working with my Growatt inverter and learned so much in the process.

I use Home Assistant and the trickiest part was figuring out how to import the values, I achieved this by adding MQTT sensors to my configuration.yaml but it's a hacky solution.

sensor:
- platform: mqtt
  name: 'Growatt Solarpower'
  state_topic: 'growatt/data'
  value_template: '{{ value_json.solarpower }}'
  unit_of_measurement: 'W'
  device_class: power

- platform: mqtt
  name: 'Growatt Enery Today'
  state_topic: 'growatt/data'
  value_template: '{{ value_json.energytoday }}'
  unit_of_measurement: 'kWh'
  device_class: energy

I was wondering if you might add the functionality to publish the sensors from your sketch into the `homeassistant/sensor/growatt' topic, as this would allow Home Assistant auto-discovery:

I borrowed this example from another solution:

Topic :homeassistant/sensor/inverter_1_pv_power/config

{"device":{"ids":["sa_inverter"],"mdl":"Growatt MIN/MIC","mf":"Growatt","name":"Growatt MIN/MIC"},"device_class":"power","name":"PV power","state_topic":"solar/inverter_1/pv_power/state","uniq_id":"inverter_1_pv_power","unit_of_measurement":"W"}
@nygma2004
Copy link
Owner

Hmmm, I have seen these homeassisant topic in my MQTT server, but never really paid much attention to them. But it does not look too complicated. But it will be a hell of a large big configuration message considering the high number of fields. I am in a middle of a large project, but I have some tidy up work to do here, so I think I will come back to this somewhere during the fall and add the homeassistant part as well.

@That-Dude
Copy link
Author

ok that sounds great, I'm looking forward to seeing the results.

I'm super pleased with your sketch, it's been working flawlessly for a week now.

@nikito7
Copy link

nikito7 commented Sep 13, 2022

For large configurations yaml it's easier to manage.

One advantage of discovery, it's create a device on HA

@nikito7
Copy link

nikito7 commented Jan 26, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants