I’m working on something to send TurnTouch remote info via MQTT. Right now, the topics look like this:
turntouch/battery 80
turntouch/mode lights
I’ve set up two sensors as such:
sensor:
- platform: mqtt
state_topic: 'turntouch/mode'
name: turntouch_mode
unique_id: turntouch_mode
value_template: '{{ value_json }}'
- platform: mqtt
state_topic: 'turntouch/battery'
name: turntouch_battery
unique_id: turntouch_battery
unit_of_measurement: '%'
value_template: '{{ value_json }}'
device_class: battery
The battery info works great! But the mode sensor is either blank or ‘unknown’.
I can see the data coming in the debug log:
2020-04-29 10:43:31 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on turntouch/battery: b'31'
2020-04-29 10:44:44 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on turntouch/mode: b'media'
2020-04-29 10:44:48 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on turntouch/mode: b'lights'
So I think I’m missing something conceptual here. I was hoping the sensor would show changes in the mode. I’ve tried mode
both with and without the RETAIN flag. The end goal is to be able to trigger changes based on the current state.
Is there some smarter way I should be trying to accomplish this?
Thank you for your help!