Look at the specs, or the pictures.
If you are using an esp, then esphome is the way to go. You can use a relay to turn the light on and also wire a switch to the esp.
You would be able to turn it on/off physically and through home assistant. It will show the correct state regardless of the turn on/off method.
You could do the same setup in ESP-Home.
You could even connect a wire between the relay output back to a pin on the ESP BUT with a voltage divider.
That way you can get the relay position.
Thank you!
I’ll look into ESP Home a little deeper as well. Hellis81 suggested wiring back to the ESP to see the state of the relay, but it sounds like your suggestion would not need it. Will ESP Home and HA stay in sync even if the relay is triggered outside of HA?
Thanks for taking the time to help a newb
That depends on the switch.
If it’s momentary button then no.
If it’s a switch then yes.
To me that’s backward. A switch will be problematic. If the switch is in the on position and the light is shut off from HA, you’d need to turn the switch off then on, to turn the light back on.
You’d need a momentary button. Then use
switch:
##Button config
- platform: gpio
pin: an unused pin
id: light_switch
## name: "My Light Switch" omit name to keep entity hidden from frontend, state is irrelvant
on_turn_on:
- delay: 250ms ##this requires the switch to be held x amount of time before triggering
- switch.toggle: light_relay
##Relay config
- platform: gpio
pin: different unused pin
id: light_relay
name: "Light Relay"
Is there no on_toggle action?
That would work for a switch.
But you are right I was thinking backwards…
I would probably still use a feedback from the relay (if that is possible) to get the true state given that relays have a tendency to stick.
That would give you two switch entities. ‘Light Relay’ would always be the actual state.
“My Light Switch” would toggle back and forth.
If you exclude the name of the momentary button switch, it will stay internal and not show in HA’s frontend. I’m editing the above to reflect that since the button switch state is irrelevant.
After a lot of digging, I found this thread: ESPHome 3ch relay and switch
It seems from this thread, I should just plan on wiring momentary buttons instead of switches. Seems like that would make life so much easier, except for outside lights, where you really need feedback from something to know if the light is actually off or not… So possible a momentary button with an led for feedback? Possibly the button Hellis81 linked to could be wired to the relay to turn on the led when the relay is active. That is a lot of extra wiring, but kind of makes sense I guess.
Any other ideas on providing feedback? Thanks again guys!
Perhaps a Sonoff 4 ch pro?
I don’t have one myself but it looks like it has LEDs to indicate on/off.
But not sure.
Read again:
POWER
Power supply AC 110-230V ±10%, 50/60Hz
Power supply DC 12V, 24 – 60V
Dry contacts Yes
So Shelly can use either AC or DC (set with a jumper).
Shelly is blizz to configure; it can re-use existing switches ’as-is’ (including the two-way hotelswitch); doesn’t need cloud (nor app) to configure, has some limited timer options and works fine without HA too.
Yes that button has a separate pin that controls the led. You would create another switch to control the led and toggle it with the relay.
switch:
##Button config
- platform: gpio
pin: an unused pin
id: light_switch
## name: "My Light Switch" omit name to keep entity hidden from frontend, state is irrelvant
on_turn_on:
- delay: 250ms ##this requires the switch to be held x amount of time before triggering
- switch.toggle: light_relay
- switch.toggle: led_status
##Relay config
- platform: gpio
pin: different unused pin
id: light_relay
name: "Light Relay"
## LED config
- platform: gpio
pin: different unused pin
id: led_status
You might consider a momentary rocker switch (spdt, center off) tied to the ESP to control on/off state. You will have fewer problems with contact bounce. The interface to HA could control the same state. I’d consider using a properly protected solid-state device (like a MOSFET) to control the 12 volts. It’d be more reliable and use less power than a relay.
The state information would always be from the ESP; no need for the relay state unless it’s a latching relay. If you use a latching relay, it can become the non-volatile memory device. You’d need to sense it’s position with a either separate contact or a voltage monitor on the relay output contact. If you pick an ESP device with flash user memory, it could remember the last-commanded state and restore the state at power-on.
One thing you need to remember is to properly isolate the ESP and the HA host from your 12 volt power source when the RV is not in use. Specifically, you don’t want the ESP to become a parasitic load to the RV battery unless it’s properly isolated by the vehicle’s power relay. Given enough time, even a milliamp load can drain a battery.
FWIW, I’d expect the ESP to be up and running before HA boots itself to an operational state.
Looks like the Sonoff is only 120v and doesn’t have the capability for a manual switch…
Thank you. I’m leaning towards a momentary button setup with some sort of visual feedback. The system needs to be completely usable and user friendly for someone without a device.
I’ll look into mosfet devices as well.
The RV is pretty self-sufficient power wise, and does have a main battery disconnect that isolates everything when in storage.
I think hard wiring visual feedback is the way to go for me. When you toggle a light on from the button or HA, an led lights up letting you know the light is on. Hit the button or toggle it in HA and the light goes off. Another wire from the relay output to the led should do the trick I think.
Yes, missed it completely. Will check it out. Thank you!
Exactly how does it look like that??
You really need to work on your reading.
What does that upper pict say?
It says you can power it from DC, but nowhere does it say it can switch DC loads, and I wouldn’t want to assume. I also see no provisions for an external switch, just the app or integration. Did I miss something there?
The image clearly says DC inputs to the relays doesn’t it?
Both the left bulb and the motor is DC.
The product page also says it has dry contacts.
The buttons labeled R1, R2, R3 and R4.
On the opposite side there is four LEDs.
I assume the buttons switch the relays and the LEDs is indication, but I don’t know since I don’t have on.
But you can probably google or look at some video about it.