Puzzling automation hickup? Help please :D

Hello everyone,

I have a weird problem.
So i have set up a automation which is meant to do the following:

Trigger: When my closet door opens. (433mhz magnet sensors)

Actions:

Google Home says something - Working
Hue Light in the closet turns on - Working
433mhz switch in kitchen turns on (just wanted to test) - Does not work.

The really weird thing is that if i do trigger this manually the switch will turn on.
BUT when i open the door to the closet (triggers in real life) the switch turns on in the hassio dashboard (see pictures below) but the switch does not turn on in real life???

Below you also see the log of my tellstick duo (433mhz controller) where it apparently sends a command to device 1 which is the kitchen switch.

Any thoughts or help are welcomed with open arms! :smiley:

image
So Köksfönstret is the kitchen switch and Magnet Sensorn is the trigger. This picture is before i open the door.

image
This is after i have opened the door, you can see they turned on but in real life the kitchen switch is off.

image
And apparently my tellstick addon did send the appropriate commands from what the logg tells…

Thinking out loud…

Do you need a delay between receiving the signal and sending the second one perhaps?

Good one! im really noob at coding, how do i add that :smiley:

Below you find my code, i did have a look at the delay part of this page. But as i said im quite the noob coder so i dont know where to put it.

  • action:
    • data:
      entity_id: switch.koksfonstret
      service: switch.turn_on
    • data:
      entity_id: light.hue_white_lamp_2
      service: light.turn_on
      alias: Walk In Closet
      condition: []
      id: ‘1515194253712’

Post the code for the whole automation (there’s no tts and no trigger in the bit you posted) and put it between 3 backticks so it makes a code block…

```
Your automaton
```

Will look like

Your automation

And we can see where the delay will go :+1:

Ok,

This works? (just learned it)
https://hastebin.com/okiharoduy.cs

One sec…

Right, you had four automations there. 2 were acting on the same trigger and doing different things, and one was doing the opposite of another, so I’ve reduced it to 2 automations which hopefully do what you want and the alias defines what they will do so hopefully if they’re not acting how you want you can move the bits around so they do.

I haven’t added a delay because I don’t know which switch is which, and also I suspect the problem was because of your conflicting automations. Let me know if it works, and if not tell me which switch is which and I’ll put the delay in the correct place.

There are no TTS actions in the automations you gave me, so I don’t know how you’re getting google home to say something, but it’s not from these automations, I can add that in too if you need me to?

Also (this isn’t your fault) the automations created by the automations editor are an absolute mess! Really difficult to debug, so write them by hand if you can.

- alias: "When magnet_sensorn goes on - turn on koksfonstret and hue lamp 2" 
  trigger:
    platform: state
    entity_id: switch.magnet_sensorn
    to: 'on'
  action:
    - service: switch.turn_on
      entity_id: switch.koksfonstret
    - service: light.turn_on
      entity_id: light.hue_white_lamp_2

- alias: "when magnet_sensorn goes off - turn off koksfonstret and hue lamp 2 - turn on grona_mobeln"
  trigger:
    platform: state
    entity_id: switch.magnet_sensorn
    to: 'off'
  action:
    - service: light.turn_off
      entity_id: light.hue_white_lamp_2
    - service: switch.turn_off
      entity_id: switch.koksfonstret
    - service: switch.turn_on
      entity_id: switch.grona_mobeln