Automation works with Dashboard but not with wall switch

Hi all,

I would like to switch off my LG TV when I press a button in my Raspberrymatic. The button is a real switch on the wall. For that I created an automation: When the status of the button changes the TV will be switched off.

The problem when I use the switch on the dashboard it works perfectly
but when I use the wall switch it doesn´t.

Maybe I´m totally blind but I´m not able to convince the wall switch to do what I want.

Please let me know when you need more information.

Thanks for your support and regards
Christian

Please post whatever automation you’ve setup

Hi Nathan,

I was to fast with the send button.

here is the code:

alias: TV Wohnzimmer aus
description: ""
trigger:
  - platform: state
    entity_id:
      - button.raspberrymatic_p_schlafen_gehen
condition: []
action:
  - service: media_player.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: media_player.tv_wohnzimmer
mode: single

regards
Christian

1 Like

It happens… Do you have a trace from that automation?

What do you mean with trace. I´m a home assistant beginner … I need a little bit more explnations.

ChD

1 Like

Thanks. I will check it today evening.

regards
CHD

This is what I found in trace

this:
entity_id: automation.tv_wohnzimmer_aus
state: 'on'
attributes:
id: '1709505645516'
last_triggered: '2024-03-06T19:17:39.381645+00:00'
mode: single
current: 0
friendly_name: TV Wohnzimmer aus
last_changed: '2024-03-06T19:11:19.942481+00:00'
last_updated: '2024-03-06T19:17:39.388369+00:00'
context:
id: 01HRAK6BDN48HGN1JC64G45669
parent_id: 01HRAK6BD79WKKNDR7GEAVC6MX
user_id: null
trigger:
id: '0'
idx: '0'
alias: null
platform: state
entity_id: button.raspberrymatic_p_schlafen_gehen
from_state:
entity_id: button.raspberrymatic_p_schlafen_gehen
state: '2024-03-06T19:17:39.368554+00:00'
attributes:
name: Schlafen gehen
friendly_name: Raffstores schlafen
last_changed: '2024-03-06T19:17:39.368763+00:00'
last_updated: '2024-03-06T19:17:39.368763+00:00'
context:
id: 01HRAK6BD79WKKNDR7GEAVC6MX
parent_id: null
user_id: 0c4d6a4576e94e1086420c68e152ed5f
to_state:
entity_id: button.raspberrymatic_p_schlafen_gehen
state: '2024-03-06T19:17:39.368554+00:00'
attributes:
name: Schlafen gehen
friendly_name: Schlafen gehen
last_changed: '2024-03-06T19:17:39.368763+00:00'
last_updated: '2024-03-06T19:20:38.233828+00:00'
context:
id: 01HRAKBT2SHYQCTKYV7BK9TFFB
parent_id: null
user_id: null
for: null
attribute: null

regards
ChD

Problem is solved.

Please check this German forum:
Automation funktioniert nur über das Dashboard - Automationen / Node-RED - simon42 Community

regards
Christian