Ok, Here.s the scenario. I have a couple of HiGrow esp32 based Soil meters that I’ve “Modified” a little. But sometimes they stop for no apparent reason. My bright idea was to check for the last_updated attribute and if that was so many seconds earlier then now, send an alert.
I’ve written the Automation, and if I trigger the automation manually, Goto to States - Automation - Trigger , the automation fires and reports that the sensor hasn’t checked in in the time specified. If I try to use the Time platform to run this test every 15 minutes, it never runs. Here is the code I’m using.
- id: auto063
alias: Garden Sensor 01 - Late Check in
trigger:
minutes: '/15'
platform: time
seconds: 00
condition:
- condition: and
conditions:
- condition: template
value_template: '{{ as_timestamp(now()) - as_timestamp(states.sensor.garden_sensor_01_water.last_updated)
| int }} > 1800'
- condition: template
value_template: '{{ not is_state(''persistent_notification.garden_sensor_01_error'',
''notifying'') }}'
action:
- data:
message: Oh oh, {{states.sensor.garden_sensor_01_temperature.name}} update is
due. Kick it! - {{now().strftime("%H:%M:%S %d/%m")}} {{ ((as_timestamp(now())-as_timestamp(states.sensor.garden_sensor_01_water.last_updated))|int)
}} Seconds Since Check in!
service: notify.family
- data:
message: Attention, {{states.sensor.garden_sensor_01_temperature.name}} update
is due. {{ ((as_timestamp(now())-as_timestamp(states.sensor.garden_sensor_01_water.last_updated))|int)
}} Seconds since check in
notification_id: garden_sensor_01_error
title: Garden Sensor 01 Error
service: persistent_notification.create
- condition: template
value_template: "{{ not is_state('persistent_notification.garden_sensor_01_error',
'notifying') }}"
EDIT: to clarify, if you use quotes inside a value template, you need to use the ‘other type’ of quotes to encompass it. Example, I have a string that I want to output: “Hello”. If I place that string into a value template to output, it would be inside single quotes:
I know this is an old post but hoping for a little help. I purchased 10 of the higrow soil sensors and did not do my home work first. I am having a hard time finding a confirmed working flash procedure and a best way to get into home assistant. Was hoping maybe you could share the procedure that you used to flash the units and add to home assistant? Please.
I am currently looking at the esphomelib as an option , but the board is not listed although the components are. Thanks in advance for your help!
In case you didn’t fix it so far, you can try this new custom firmware that exposes everything via MQTT.
There will be version 2.0 of firmware that should handle auto discovery (hopefully) and would need only 2 configuration options - mqtt server info and WiFi info.