I’ve modified my desk lamp with a wemos d1 mini running tasmota to make it “smart”. Since I need to toggle the physical button on my lamp, I use the tasmota “relay1” with “PulseTime 1”. The actual relay hence is always powered off. I have an analog read (ADC0) to see whether my lamp is currently turned on/off (since I can also use the original switch on it)
Now all I need to do is configure a light in Home Assistant that sends a Toggle command to tasmota when being turned on/off but that uses the analog read from my tasmota device as a state_template (>100 it’s turned on, <100 it’s turned off)
I read through the docs and also looked at a few examples, but I’m really not sure how to make this work. I could also extract the state as a sensor and then make it work but I would like not to go that route if not necessary.
invalid config for [light.mqtt]: [state_value_template] is an invalid option for [light.mqtt]. Check: light.mqtt->state_value_template. (See ?, line ?).
My device needs to send it’s tele data in order for HA to receive them.
So I added the rule that sends an tele update whenever my analog read changes more than 10%:
{"Rule3":"ON","Once":"OFF","StopOnError":"OFF","Length":54,"Free":457,"Rules":"ON ANALOG#A0div10 DO publish tele/%topic%/SENSOR ENDON"}
It kind of works, but for whatever reason the message that is published is empty: