Hi, I’m having difficulty changing the attribute of a Monoprice door/window sensor. The sensor currently shows 22 for open and 23 for close. I know I can use template to make the changes :
It doesn’t seem to work for me, I’m getting the following error when I restart
2017-11-21 20:37:03 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 115). Please check the docs at https://home-assistant.io/components/sensor/
I copied and pasted your template into my sensors.yaml and only changed the sensor name. I commented out everything else I had in it, I no clue as to why it errors out on me…
I figured out my issue. I had forgotten I had a separate binary_sensors.yaml I created back sometime for another project, after inserting the new line into it, it is working as expected!!
I have a d’link DCH-Z110 door sensor wich also shows 23/22 value for closed/open door.
I added your code at the end of my config.yaml but I’m getting this error
2018-01-16 16:14:42 ERROR (SyncWorker_0) [homeassistant.util.yaml] mapping values are not allowed here
in “/home/homeassistant/.homeassistant/binary_sensors.yaml”, line 3, column 12
2018-01-16 16:14:42 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: mapping values are not allowed here
in “/home/homeassistant/.homeassistant/binary_sensors.yaml”, line 3, column 1