Newbie question: Make a switch turn on when another one does

Hi! I’ve been trying to make this work for too long now. I need help!

In my house, I have several wall switches from Nexa. I have several wall socket-switches that lights are connected to. I use a VM (Debian) with a tellstick duo connected to it.

What i want to accomplish is that when i push on the nexa switch - off, I want to be able to tell home assistan which lights to turn off.

I managed to get home assistant react to the button press of the remote so when i press lights-off on the wall-switch, it registers as off in home assistant. I would just like to tell other switches to follow. How do I do this?

read the section on automation. https://home-assistant.io/getting-started/automation/ What you are talking about is a basic trigger/Action type of animation. You will have a trigger defined that when it happens an Action (turning on the wall outlet) will happen.

I have tried that but I can’t find enough reference/examples to understand how to write the code. This is my section as it looks right now:

automation:
  - alias: Tänd grejer när brytarn trycks
    trigger:
      platform: state
      entity_id: switch.vaggbrytare_2_vardagsrum
      to: 'on'
    action:
      service: homeassistant.turn_on
      entity_id: switch.fjarrbrytare_16_sovrumsfonster
  - alias: Släck grejer när brytarn trycks
    trigger:
      platform: state
      entity_id: switch.vaggbrytare_2_vardagsrum
      to: 'off'
    action:
      service: homeassistant.turn_off
      entity_id: switch.fjarrbrytare_16_sovrumsfonster

But when I press the Switch, the only thing that changes is the status light in the home-assistant homescreen. If anyone would like to review the code, please do and where possible improve or explain what I’m doing wrong. Thank you!

Instead of “homeassistant.turn_on/off” for the service, try “switch.turn_on/off”. Like I said, it’s been a while.

I hope I’m not highjacking your thread here, but I’m trying to do the same thing, sort of. I seem to have stumbled a bit earlier though.

I would like to use a Nexa remote and upon pressing a button perform some automation. I suppose this is very similar to reacting to a wall switch.

However, I don’t really understand how I would model this in Home Assistant. The only way I’ve come up with so far is to add a fake on/off switch in Telldus Center and map it to one of the buttons on the remote. That way a switch ends up in Home Assistant and according to the log it seems to be reacting to my button presses.

Is this the way you managed to record the wall switch as well or is there a better solution?

The wall switch should show up as an entity discovered by Home Assistant (HA)(not laughing abbreviating). Somehow you need to get your remote to show up as a device in HA. Then like the wall switch, based on the trigger of a button being pressed, you will perform an action. With that said, I have not ever played with remotes like that so I have no idea how to make it show up in HA (sorry). But the concept is the same.

Alright, I solved it. The problem was that the names of my Tellstick-devices had names like “Min första lampa”. What Home Assistant does is to add two underscores to the first space between “Min” and “första” and then adds just one underscore between “första” and “lampa”. In my config, as you can see, I only wrote one underscore for each space. Thank you all for your replies!

Hi bjorne, sorry for my late reply.

What OS are you using? I use Linux Debian with telldusd running. I followed a guide which I believe I found here: https://github.com/telldus/telldus/tree/master/telldus-core but I am not sure if that was the guide that got it working for me. One thing I know for sure is that I used the command tellcore_events --raw to get the Tellstick Duo to listen for remote-codes.

When and if I have to install it again I could write a guide but for now this is the only info I can give. Hope it helps!