Add Dual Outlet - Couch to single-press button automation #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Door Button single-press toggles
Squiggle,Sideboard Lamp,Bamboo Lights(all_plugs). Wanted to add the newDual Outlet - Couch(0x4ce175523f710000, ThirdReality BL702 dual plug) to the same single-press action.Finding (bug)
The dual plug ignores
{state:"TOGGLE"}on its/settopic — nothing happens. It only responds to per-channel commands:{"state_1":"TOGGLE"}/{"state_2":"TOGGLE"}(verified on live device)So a multi-channel device needs a dedicated mapper, not the shared
{state:"TOGGLE"}payload the currentsingle-filteremits.Change
In
flows/zigbee-monitor.yaml:Dual Outlet - Couchtosingle_plugszigbee-state-couch(state in),couch-mapper(function →{state_1:"TOGGLE",state_2:"TOGGLE"}),plug-out-couch(/set),text-couchdashboard widget (showsstate_1/state_2)single-filter → couch-mapper → plug-out-couch{{msg.payload.state_1}} / {{msg.payload.state_2}}(dual plug publishes per-channel, not a singlestate)Verification
/setemitted{"state_1":"TOGGLE","state_2":"TOGGLE"}→ both outlets flipped ON→OFFFollow-up risk
The generator's shared
{state:"TOGGLE"}fromsingle-filtersilently fails on any multi-channel device. Other plugs inconfiguration.yamlworth auditing for the same issue.Follow-up on the generator risk: resolved.
flow2json.pynow hasbuild_plugs(). A flow declares aplugs:table ({id, name, channels?}) plussingle_plugs/hold_plugslists andsingle_filter/hold_filterids; the generator auto-emits all per-plug plumbing: state-in node,/setout node, dashboard widget, and for multi-channel devices (channels: [1,2]) a mapper function that toggles each channel (state_1/state_2) instead of the ignored shared{state:TOGGLE}payload.zigbee-monitor.yamlrewritten to declarative form —Dual Outlet - Couchis declared as multi-channel. Adding a plug is now a one-line change with no manual node/wire duplication.Verified: 567 Rego checks pass, single-press toggles 5 devices (couch flips both channels E2E), hold-release still DJ Booth only. Committed as
b9c53c1.