Hi all,
I have an aqara temperature sensor which is working fine and I have configured a notify integration that can be used to send messages to my rsyslog daemon. This is all on a Debian box with Home Assistant (not Hass.io). I can define a trigger so that when the temperature changes, a message is logged to rsyslog and that is all smiley and good
However, my end goal is to send the temperature to rsyslog every X minutes regardless of whether it has changed or not. I already have a second notify integration that logs a basic text message every 10 seconds (for testing purposes, it will be longer in the end). What I am struggling with is how to get the temperature from the sensor to send in the 10 second log message.
Here is my automation block:
- id: '9990000000002'
alias: 10s to syslog
trigger:
- platform: time_pattern
seconds: /10
condition: []
action:
- data_template:
message: "TEMP = {{ sensor.multi01_3.to_state }} "
service: notify.iot_event
On the states
page in HA, I see the entity as sensor.multi01_3
and the state
shows the temp ok. When running HA, the error message says sensor
doesnβt exist (full message below). I think I am missing something basic with what I am trying to do but not sure where to look or what it is
Full error message:
2019-11-06 17:46:10 ERROR (MainThread) [homeassistant.helpers.service] Error rendering data template: UndefinedError: 'sensor' is undefined
For completeness, here is my notify block for syslog:
- name: iot_event
platform: syslog
facility: local7
priority: 1
Any help would be greatly appreciated
Thanks,
Rich