Hi,
I have received my bub and I have installed the Tasmota firmware from: https://github.com/arendst/Sonoff-Tasmota/wiki
I have it working in HA, just getting an error in the logs that I would like to resolve.
All the examples I have found suggest that this should work correctly, so I’m not sure if it’s something I have wrong or an issue/not yet supported feature.
When the light is switched on, I see the following MQTT commands which are corret:
cmnd/sonoffb1/POWER ON
stat/sonoffb1/RESULT {"POWER":"ON"}
stat/sonoffb1/POWER ON
I get the following error in the HA log.
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
self._callback(*self._args)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/mqtt/__init__.py", line 232, in async_mqtt_topic_subscriber
hass.async_run_job(msg_callback, dp_topic, payload, dp_qos)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 247, in async_run_job
target(*args)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/mqtt.py", line 233, in brightness_received
device_value = float(templates[CONF_BRIGHTNESS](payload))
ValueError: could not convert string to float:
My config:
light:
- platform: mqtt
name: "Lounge lamp"
command_topic: "cmnd/sonoffb1/POWER"
state_topic: "stat/sonoffb1/POWER"
# state_value_template: "{{ value_json.state }}"
rgb_command_topic: "cmnd/sonoffb1/COLOR"
rgb_command_template: "{{ '#%02x%02x%02x0000'| format(blue, green, red) }}"
# rgb_state_topic: "stat/sonoffb1/COLOR/RESULT"
brightness_state_topic: "stat/sonoffb1/RESULT"
brightness_value_template: "{{ value_json.Dimmer }}"
brightness_command_topic: "cmnd/sonoffb1/DIMMER"
brightness_scale: 100
color_temp_command_topic: "cmnd/sonoffb1/CT"
# color_temp_state_topic: "stat/sonoffb1/RESULT"
# color_temp_value_template: "{{ value_json.CT }}"
qos: 0
payload_on: "ON"
payload_off: "OFF"
optimistic: false
retain: true
The issues is related to the following config, if I remove the lines I get no errors, but the brightness state is not maintained in the GUI.
brightness_state_topic: "stat/sonoffb1/RESULT"
brightness_value_template: "{{ value_json.Dimmer }}"
There is no Dimmer value present in the topic when it first turns on: stat/sonoffb1/RESULT so it shouldn’t be matching anything, why the error???
stat/sonoffb1/RESULT {"POWER":"ON"}
stat/sonoffb1/POWER ON
Thanks for any light you can shed on the issue!