I have searched for a while now, but the documentation seems very scant. I would like to use the numeric_state trigger for the battery level of my iphone. So this is what I put in the trigger:
platform: numeric_state
entity_id: sensor.jeroens_iphone_battery_level
attribute: unit_of_measurement
below: '80'
However in the logs I get the following error message:
Error initializing ‘Start Charger Iphone Jeroen’ trigger: In ‘numeric_state’ condition: entity sensor.jeroens_iphone_battery_level state ‘%’ cannot be processed as a number
I understand the error message, because I guess the entity sensor.jeroens_iphone_battery_level gives its value in %. I tried adding to the trigger:
unit_of_measurement: '%'
But this generates an error in the gui:
Message malformed: extra keys not allowed @data[‘unit_of_measurement’]
Again I understand the error message. The platform numeric_state does not allow extra keys added.
So how would I go about using the output of sensor:jeroens_iphone_battery_level in the numeric_state platform? And what does the attribute “unit_of_measurement” actually do? Where can I set it?
Thanks for your help!