I recently set up an ESP32 which monitors and sends how many amps it measures to an MQTT topic once a second. I’m trying to figure out the best way for HA to turn toggle the power on a separate device based on what range the amp value is in.
Example:
If the payload of officeac/amps is > 0.06, turn on light1.
If the payload of officeac/amps is < 0.5, turn off light1
I tried setting this up in Automations, but seemingly could only use static values as the trigger.
If you happen to know and don’t mind, what would I use for the action if I wanted to publish to MQTT as the action. For instance if I wanted to publish the payload “on” to the topic “sensor.officeacvariable” if the value was above 0.5 and “off” if below 0.06?
Please consider marking my post above with the Solution tag. Only you, the topic’s author, can mark one post to represent the solution. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.