Sensor value + email notification

Hi, I would like to send email notification, when some value of sensor rise about level. Now I am trying just to send that value with email to me. My code looks like this:

script.yaml

test_notification:
    alias: 'Test Gmail Notification'
    sequence:
      - service: notify.alert_jarvis
        data: 
          message: Temperature regulator measured value is: {{ states.sensor.measure_regulatortemp_modul }}

Recieved email text:

Temperature regulator measured value is: <template state sensor.measure_regulatortemp_modul=24.25; unit_of_measurement=°C, friendly_name=measure regulatorTemp_modul @ 2019-04-11T14:21:41.549855+02:00>

How can I just recieved “value” of sensor not this whole text??

SOLVED!!

you have to write “.state” after the code like this:

{{ states.sensor.measure_regulatortemp_modul.state }}

Or write it as a function:

{{ states('sensor.measure_regulatortemp_modul') }}
2 Likes

Please can you help in this? I want to send email notification when value of battery percentage is lower then 15%.

My code:
automation:

  • alias: send Email battery low
    trigger:
    platform: numeric_state
    entity_id: sensor.phone_battery
    value_template: ‘{{ state.attributes.battery }}’
    below: 15
    action:
    • service: notify.alert_jarvis
      data:
      message: “Low battery!”

service: notify.alert_jarvis is working great - I test it with button so there should not be a problem…

1 Like