basking-in-the-sun2000 / solar-logger

A datalogger for a solar inverter. Stores data in influxdb and displays it in grafana. Has load diverting capability, to use the inverter's excess power
GNU General Public License v3.0
97 stars 31 forks source link

MQTT Publish #27

Closed bdkacz closed 2 years ago

bdkacz commented 2 years ago

Hi.

Is it possible to add function to publish via MQTT current power and daily production ?

Home Assistant add new Energy management function https://www.home-assistant.io/blog/2021/08/04/home-energy-management/

,but it doesn't work with influxdb sensor as production value

Maybe use http://www.steves-internet-guide.com/publishing-messages-mqtt-client/

basking-in-the-sun2000 commented 2 years ago

It is possible to use mqtt. However since the data is already in influxdb, you could have another process send the data to the broker, or add extra data with Telegraf.

Could you let me know what you are trying to do? Seems you solved this, but curious about your application.

bdkacz commented 2 years ago

I wanted to do this because after a few hours of trying HA did not want to correctly interpret the influxdb database data. But since I finally succeeded, I closed the issue

WMP commented 2 years ago

Could you told me how you solve this?

bdkacz commented 2 years ago

Could you told me how you solve this?

I create influxdb sensor based on https://www.home-assistant.io/integrations/influxdb/

with query

queries:

and template sensor using this influxdb sensor with attributes
unit_of_measurement: "kWh" device_class: energy state_class: total_increasing

then I can add created template sensor to energy panel as value of production

f432 commented 2 years ago

Has anyone been able to setup exported energy into Home Assistant using influxdb as a sensor? I've spent days on it but my knowledge is not there,

Thought I would try here before asking in the HA forums.