In the last version of hassio (143) the option “on_command_type” seems broken:
I wrote, in the conf file:
on_command_type: ‘first’
…and got this error (which did not happen in the previous version):
2019-02-18 19:14:24 ERROR (MainThread) [homeassistant.config] Invalid config for [light.mqtt]: [on_command_type] is an invalid option for [light.mqtt]. Check: light.mqtt->on_command_type. (See /config/lights.yaml, line 0). Please check the docs at https://home-assistant.io/components/light.mqtt/
Please post the formatted configuration of the affected light. It may help provide clues as to why Home Assistant considers on_command_type to be invalid (despite it being a valid option).
BTW, I assume you used the correct quotes (' or ") to delimit first and not the ones shown in your post (‘first’).
Thanks. Now I see why Home Assistant has rejected on_command_type.
When you use schema: json the list of valid configuration variables is different from the standard version of MQTT Light. The JSON version does not support on_command_type.
In previous versions, Home Assistant would ignore invalid options. Starting with 0.87 invalid options are identified and Home Assistant will reject the associated entity. You must remove on_command_type from this entity’s configuration.
I’d like to draw your attention to two other issues in your configuration. You have specified a state_topicand set optimistic: true. Why?
If the device reports its state (via state_topic) then there’s normally no need to use optimistic: true. Set it to optimistic: false or delete it (false is the default).
If the device does not report its state then its helpful to use optimistic: true.
You have also specified retain: true. This is normally inadvisable because it can cause the device to be activated when it, or the MQTT broker, restarts (or WiFi disconnects/reconnects). I provided a more detailed explanation of the issue in this post. I suggest you set it to retain: false or delete it (false is the default).
Thanks for your detailed answer. The template is not mine, but it is taken from
I’ll send a note about that to the author of the template.
About “optimistic”: I used this option because the on/off button on the light flickered in the past version of hassio. In this new version the problem doesn’t occur (although it doesn’t seem to have a perfect behavior)
For future reference, when you encounter problems with something from a GitHub repository, first check if there are any existing Issues it may have. For example, the problem you described, concerning on_command_type, was already reported to the author (two weeks ago):