I’m trying to create a template sensor for the load power and power consumed. I have two plugs, the template sensor is working for one but not the other and hass is giving me this error in the log:
2017-08-09 09:10:54 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 1782).
I have the same configuration for the two sensors, can’t understand why it’s not working.
As i said, the code is working with one of the power plugs but not the other. And I get an error in the log, using the exact same code with different entity_id. The error only appears when I add the template sensor. Other than that the plug is working, but i can’t creat the template sensor for this plug, also HA doesn’t restart if the sensor is added to the config file.
It is an error, as I said both template sensors(load power and consumed power) are working with one of the plugs.
When I create the template sensor with the exact same configuration for the other plug I get this in HA logs:
2017-08-09 09:10:54 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 1782). Please check the docs at https://home-assistant.io/components/sensor/
And I don’t understand why I get this in the log: “required key not provided”
2017-08-09 13:07:07 ERROR (Thread-2) [homeassistant.util.yaml] while parsing a block mapping
in “/home/homeassistant/.homeassistant/sensor.yaml”, line 121, column 9
expected , but found ‘{’
in “/home/homeassistant/.homeassistant/sensor.yaml”, line 124, column 26
2017-08-09 13:07:07 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping
in “/home/homeassistant/.homeassistant/sensor.yaml”, line 121, column 9
expected , but found ‘{’
in “/home/homeassistant/.homeassistant/sensor.yaml”, line 124, column 26
Yes, they’re both showing in the app and in dev state they’re both providing attributes and working. I don’t know if it makes any difference, but the plug that’s giving me the error was bought recently.