Tidone / homeassistant_eta_integration

Integration of ETA (Heating) sensors and switches to home assistant
MIT License
21 stars 1 forks source link

any hint for notify #5

Closed greentux closed 9 months ago

greentux commented 9 months ago

Hi, I get the event data

event_type:` eta_webservices_error_detected
data:
  msg: Test
  priority: Error
  time: "2023-11-06T12:48:12"
  text: This is a test error.
  fub: Kessel
  host: 0.0.0.0
origin: REMOTE
time_fired: "2023-12-01T08:50:45.733309+00:00"
context:
  id: 01HGJ95FB5B836G7WD82W1P6X6
  parent_id: null
  user_id: 91d7dde1fb254f8a9eda633c2756b352

but how can I use the data fields in automatisation?

alias: ETA error message
description: >-
  Sendet eine Nachricht, wenn der Pelletkessel einen Fehler meldet. Meldung
  erfolgt per Telegram und Email.
trigger:
  - platform: event
    event_type: eta_webservices_error_detected
condition: []
action:
  - service: notify.telegram_myhome
    data:
      title: ETA heating
      data:
        '{{trigger.event.data.text }}'

mode: single

has problems with the data dict...

any hints? thanks

Tidone commented 9 months ago

Hi,

According to the telegram integration page the telegram data field has to include at least the message field. Your action should look like this (the title is optional):

action:
  service: notify.telegram_myhome
  data:
    title: "ETA error triggered"
    message: "The following error has been triggered: {{trigger.event.data.text}}"

Here is a working example automation using the system_log service:

alias: ETA Error Event
description: ""
trigger:
  - platform: event
    event_type: eta_webservices_error_detected
condition: []
action:
  - service: system_log.write
    data:
      level: warning
      message: "ETA Event triggered: {{trigger.event.data.text}}"
mode: single
greentux commented 9 months ago

Oh, shame on me... You are right. I looked at the false end... thanks a lot!

Tidone commented 9 months ago

You're welcome!