I want to generate a message on the Home Assistant home page whenever the numeric value of a sensor is at or below a certain value. However, I can’t figure out how to tell the component in automation.yaml which sensor in configuration.yaml to test.
I’ve created a sensor in configuration.yaml as follows:
sensor:
- platform: command_line
name: 'Test Command'
unit_of_measurement: days
scan_interval: 43200 # 12 Hours
command: 'mycommand'
I also created this entity in automations.yaml:
- alias: 'Test Notification'
trigger:
platform: numeric_state
entity_id: ??????
below: 10
action:
service: notify.notify
message: 'Test message'
What entity ID do I use to refer to the value generated by the sensor?
I tried specifying an entity_id for the sensor (this was shown in numerous examples), but I got this warning from Home Assistant:
Your configuration contains extra keys that the platform does not support.
Please remove [entity_id]. (See /home/homeassistant/.homeassistant/configuration.yaml,
line 34).
Both with and without the entity_id attribute, the Check Configuration function says everything is okay. Apparently, however, the entity_id attribute is no longer used to identify sensors after v0.88.
I’ve searched the documentation and looked at a bunch of examples in the Cookbook, but I can’t find anything that answers my question.
My platform: I installed Home Assistant on an Odroid C2 running Armbian Stretch in a virtual environment using the instructions at https://www.home-assistant.io/docs/installation/raspberry-pi/. I’ve installed an SSL certificate following the instructions at https://www.home-assistant.io/docs/ecosystem/certificates/lets_encrypt/.
One other question: Is there any significant difference between using single quotes or double quotes in the configuration files?
I’ll be grateful for any advice.