Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103050

Filter negative values in MQTT Publish automation

$
0
0

Hi

I’m fairly new to HASS.
I’m running the Huawei Solar integration and it’s working almost perfect.
I’ve created an automation to send my current power (coming from my solar panels) and total daily yield via MQTT to Domoticz using this code:

service: mqtt.publish
data:
  topic: domoticz/in
  payload: >-
    { "command": "udevice", "idx": 728, "nvalue": 0, "svalue": "{{
    states.sensor.active_power.state }};{{ (states.sensor.daily_yield.state) |
    round(3) * 1000 }}"}

However… everyday at 6AM, the daily yield value gets reset to 0. This results in a big negative value being send to MQTT/Domoticz. Is it possible to filter out a negative value in states.sensor.daily_yield.state please?

Tnx!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>