Ciprian
(Ciprian)
August 30, 2023, 10:16am
1
Hello,
I try to create an automatization to receive on telegram the exact name of last event of the litter box but I receive the same error continuously: Message malformed: extra keys not allowed @ data[‘0’]
Any ideas?
- alias: Testing
trigger:
- platform: state
entity_id: sensor.petkit_pura_max_last_event
action:
- service: telegram_bot.send_message
data:
message: "{{ trigger.name }}"
title: Activity
mode: single
Thx!
jeffcrum
(Jeff Crum)
August 30, 2023, 9:46pm
2
trigger.name doesn’t exist. Try trigger.to_state.name I think.
msp1974
(Mark P)
August 31, 2023, 8:48am
3
More likely your formatting (indentation) is wrong in data. Should be
- alias: Testing
trigger:
- platform: state
entity_id: sensor.petkit_pura_max_last_event
action:
- service: telegram_bot.send_message
data:
message: "{{ trigger.name }}"
title: Activity
mode: single
Ciprian
(Ciprian)
August 31, 2023, 1:28pm
4
Thank you
@jeffcrum to_state is a step forward
@msp1974 also the indentation was a problem, I did not noticed the extra space used.
Now I receive messages but still I am not receiving the name of last state:
I am receiving the friendly_name, instead the triggerd state like manual_odor_completed and I think I can not obtain that.
Thx!
Ciprian
(Ciprian)
August 31, 2023, 2:28pm
6
I tried that already, some errors from logs:
jeffcrum
(Jeff Crum)
August 31, 2023, 2:49pm
7
1 Like
msp1974
(Mark P)
August 31, 2023, 3:45pm
8
Given you are using a state change trigger, you could just use.
message: "{{ states('sensor.petkit_pura_max_last_event') }}"
2 Likes
Ciprian
(Ciprian)
September 4, 2023, 12:08pm
9
Thank you @msp1974 , now I receive the notification each time when new event is triggered.
Thank you all for help!
Have a good day!