mr-manuel / venus-os_dbus-mqtt-pv

This Venus OS driver gets the data from MQTT and displays it as pv inverter.
MIT License
61 stars 13 forks source link

fault in mqtt payload when using states in Home Assistant #40

Closed broekieman closed 1 month ago

broekieman commented 1 month ago

Manual's example has a correct Json format, but his automation sample for Home Assistant gives fault.

If i put his sample in: https://jsonformatter.org No problems but when i put this in it i get this fault:

Parse error on line 3: ... "power": {{ (states('sensor.YO -----------------------^ Expecting 'STRING', '}', got '{'

{ "pv": { "power": {{ (states('sensor.YOUR_PV_POWER_ENTITY') | float(0)) }}, "L1": { "power": {{ (states('sensor.YOUR_PV_L1_POWER_ENTITY') | float(0)) }}, }, "L2": { "power": {{ (states('sensor.YOUR_PV_L2_POWER_ENTITY') | float(0)) }}, }, "L3": { "power": {{ (states('sensor.YOUR_PV_L3_POWER_ENTITY') | float(0)) }}, } } }

broekieman commented 1 month ago

Manual's example has a correct Json format, but his automation sample for Home Assistant gives fault.

If i put his sample in: https://jsonformatter.org No problems but when i put this in it i get this fault:

Parse error on line 3: ... "power": {{ (states('sensor.YO -----------------------^ Expecting 'STRING', '}', got '{'

{ "pv": { "power": {{ (states('sensor.YOUR_PV_POWER_ENTITY') | float(0)) }}, "L1": { "power": {{ (states('sensor.YOUR_PV_L1_POWER_ENTITY') | float(0)) }}, }, "L2": { "power": {{ (states('sensor.YOUR_PV_L2_POWER_ENTITY') | float(0)) }}, }, "L3": { "power": {{ (states('sensor.YOUR_PV_L3_POWER_ENTITY') | float(0)) }}, } } }

broekieman commented 1 month ago

This is solved!