home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.76k stars 7.18k forks source link

Sensor data example not included in https://www.home-assistant.io/integrations/smtp/ #34001

Open terren272 opened 1 month ago

terren272 commented 1 month ago

Feedback

Please explain how sensor data can be included in these emails. This info is not in https://www.home-assistant.io/integrations/smtp/

This can be done via an esphome implementation, but seems not allowed in homeassistant directly?

This works in Developer Tools, Services: service: notify.sendemail data: message: The garage door has been open for a while. title: Your Garage Door Friend target: 858XXXXXXX@txt.att.net

This does not work in Developer Tools, Services: service: notify.sendemail data: message: The garage door has been open for {{ states('sensor.solaredge_current_power') }} title: Your Garage Door Friend target: 858XXXXXXX@txt.att.net

  The UI does not support templates, you can still use the YAML editor.

no data is included in message

Like I said. This would work when called from esphome device, like this;

URL

https://www.home-assistant.io/integrations/smtp/

Version

2024.7.3

Additional information

Please explain how sensor data can be included in these emails. This info is not in https://www.home-assistant.io/integrations/smtp/

terren272 commented 1 month ago

I created a working example working backwards from automation. This works from Dev Tools Services , which seems an unreliable testing ground since automation method auto corrected what was missing.

service: notify.sendemail metadata: {} data: message: >- Solar producing < 200W as of 10am. Current Solar Power is {{ states('sensor.solaredge_current_power') }} . Energy Produced Today {{ states('sensor.solaredge_energy_today') }}

title: >- Solar Power {{ states('sensor.solaredge_current_power') }} . Energy Today {{ states('sensor.solaredge_energy_today') }} data: "[object Object]": null