Stateful illuminated switch (momentary + independent LED)

wheel / pinch = zoom ยท drag = pan
switch_led_stateful 2014 RAM 1500 Carputer โ€” STATEFUL ILLUMINATED SWITCH (momentary button + independent LED, state held by Waveshare) One press toggles ยท voice can also toggle ยท the LED is driven by the Waveshare so it ALWAYS shows the true state, no matter which changed it. Use a MOMENTARY pushbutton with a SEPARATE LED (4 wires: 2 contact + 2 LED).  NOT a latching switch (it would lie about state once voice changes it). LEGEND:   blue = DI signal in   ยท   green = LED-drive (DO sink)   ยท   purple dashed = DO trigger   ยท   red = 12V / load power   ยท   magenta = RS485 Modbus   ยท   teal = MQTT/voice cluster_switch DASH SWITCH โ€” ONE physical part (momentary + independent LED), 4 wires sw_c CONTACT (momentary, NO) terminals: COM + NO io Modbus RTU IO 8CH @ PANEL  (SKU 26244) DIx reads the button ยท DOy drives the LED (both local โ€” short runs) RS485 SLAVE addr 2 sw_c->io NO -> DIx (press = momentary pulse) sw_l LED (independent) terminals: LED+  +  LED- sw_l->io LED- (cathode) -> DOy DOy sinks to GND when STATE=ON gnd chassis / panel GND gnd->sw_c COM -> GND (dry contact) p12 +12V (panel, fused) res series resistor (only if LED not 12V-rated; ~1k @12V / ~330R @5V) p12->res 12V res->sw_l LED+ (anode) ctrl Waveshare ESP32-S3 8DI-8DO HOLDS rock_lights STATE (source of truth) RS485 MASTER ยท ESPHome ctrl->io RS485 A/B + GND (one Cat5 home) master polls DIx, writes DOy relay Bosch relay (relay/fuse box) triggered by a DO ctrl->relay DO trigger (rock lights) note STATE = rock_lights  (single source of truth in the Waveshare) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Inputs that change STATE:   โ€ข button press  (DIx rising edge)  ->  TOGGLE state   โ€ข voice / app   (MQTT)            ->  SET state on/off STATE then drives BOTH outputs together:   โ€ข DO -> relay -> ROCK LIGHTS   (the load)   โ€ข DOy -> switch LED            (feedback lamp) => button and voice always agree; the LED always   shows the real state, however it was changed. โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ESPHome sketch:  binary_sensor (momentary)  on_press: switch.toggle rock_lights  switch 'rock_lights' (template):     turn_on:  DO(relay)=ON,  DO(led)=ON     turn_off: DO(relay)=OFF, DO(led)=OFF  (voice/app call the same rock_lights switch) voice Voice / app  (MQTT via Pi broker) "turn on/off rock lights" voice->ctrl MQTT set state rock ROCK LIGHTS (house 12V, fused) relay->rock switched + fused 14-12 AWG

open the PDF version โ€บ

โ€น prevnext โ€บ