Entity value to mail, once per week

How to send entity value of mqtt power meter, every week to mail?

power meter entity: sensor.skupna_poraba

Thank you!
Alex


service: notify.gmail
data:
  title: 'Tæller: Månedsoversigt'
  message: >-
    :: {{ states ('sensor.skupna_poraba') }} ::

you also have to setup mail

Thank you!

How to set the time for sending?

maybe this

condition: time
after: '12:00:00'
weekday:
  - fri

Automations require a trigger, a time trigger is appropriate for your automation. You can set it for any time that you woud like. To limit it to one day a week, you can use a time condition with a weekday variable.

alias: Weekly Power Meter Email
trigger:
  - platform: time
    at: '1:00:00'
condition:
  - condition: time
    weekday:
      - fri
action:
  - service: notify.gmail
    data:
      title: 'Tæller: Månedsoversigt'
      message: >-
        {{ states('sensor.skupna_poraba') }}

Yes, it should be a trigger :slight_smile:

weekday can’t be set by the UI.

Perfect!

THANK YOU!

1 Like