Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95365

Sending temperature data to syslog based on time

$
0
0

@renwickr wrote:

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 :slight_smile:

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 :frowning:

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 :slight_smile:

Thanks,
Rich

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>