I’ve got a Sonoff iFan02 ceiling fan controller that I’ve flashed with Tasmota. The Sonoff sends a status message to the same MQTT topic (stat/sonoff_MBR_fan/RESULT) for both the fan speed and the light condition (on or off) but containing different payloads.
If it is sending a fan speed status the resulting message payload is {“FanSpeed”:X} where X = the speed in numerical form from 0 to 3.
If it is sending the light status the message payload is {“POWER1”:“ON”} (or :“OFF”).
I want to create a sensor that only senses the payload when sending the status of the FanSpeed but ignores the status of the POWER1.
the following sensor will correctly read the changes in the fan speed as long as the power message doesn’t change;
so if I get this right, the message contains both fan speed and light status, but if you just change the light status, the fan speed is not automatically provided in the message? If so the fan speed sensor will indeed return blank.
Hi @VDRainer,
For my own learning/understanding, and possibly a silly question, but would that not potentially run into an infinite loop when value_json.FanSpeed is not defined? Or is HA clever enough to handle this situation?