First at all, sorry but i couldn’t find this on ESPHome website, or this forum. Also i know this is a really nobish question. Basicly, i have two esp’s, one is light switch:
switch:
- platform: gpio
name: "Relay"
pin: 0
id: Light1
And it works, i can controll it from HA, and also i want to controll it from the other esp (i want to make a light switch with a button), and here is the code for it:
binary_sensor:
- platform: gpio
name: "LightSwitch"
pin: 0
on_click:
min_length: 50ms
max_length: 350ms
then:
- switch.toggle: Light1
What i struggle with, is the last line of the second script:
- switch.toggle: Light1
When i type this, it tells me that there is no ID like that. How do i reference the switch ID of another esp?