cmnd/sonoff_front/Dimmer 100
stat/sonoff_front/RESULT {"POWER":"ON","Dimmer":100}
cmnd/sonoff_front/POWER OFF
stat/sonoff_front/RESULT {"POWER":"OFF"}
stat/sonoff_front/POWER OFF
Cool! Works. But one more issue… When I just set power on in the UI, in the log I get:
Jan 30 19:24:03 hassbian hass[9864]: 2018-01-30 19:24:03 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback async_subscribe.<locals>.async_mqtt_topic_subscriber('stat/sonoff_front/RESULT', b'{"POWER":"OFF"}', 0) at /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/mqtt/__init__.py:213
Jan 30 19:24:03 hassbian hass[9864]: Traceback (most recent call last):
Jan 30 19:24:03 hassbian hass[9864]: File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
Jan 30 19:24:03 hassbian hass[9864]: self._callback(*self._args)
Jan 30 19:24:03 hassbian hass[9864]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/mqtt/__init__.py", line 232, in async_mqtt_topic_subscriber
Jan 30 19:24:03 hassbian hass[9864]: hass.async_run_job(msg_callback, dp_topic, payload, dp_qos)
Jan 30 19:24:03 hassbian hass[9864]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 253, in async_run_job
Jan 30 19:24:03 hassbian hass[9864]: target(*args)
Jan 30 19:24:03 hassbian hass[9864]: File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/mqtt.py", line 241, in brightness_received
Jan 30 19:24:03 hassbian hass[9864]: device_value = float(templates[CONF_BRIGHTNESS](payload))
Jan 30 19:24:03 hassbian hass[9864]: ValueError: could not convert string to float:
Seems like I need some kind of template where Dimmer-value can be undefined… But I don’t know how to do that.