I’ve been doing a lot of research on this, and I’ve been trying it with the node-red-contrib-dsm using the “traffic lights” example, and I just cant get it figured out. Currently, it just flashes through all the colors and stops at Green. Does anyone have any thoughts?
[{"id":"632239a.6b393c8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"3e26b6d9.0745fa","type":"dsm","z":"632239a.6b393c8","name":"traffic lights","sm_config":"{\n \"stateOutput\": \"payload\",\n \"currentState\": \"off\",\n \"states\": {\n \"off\": {\n \"tick\": \"red\"\n },\n \"red\": {\n \"tick\": \"red-yellow\"\n },\n \"red-yellow\": {\n \"tick\": \"green\"\n },\n \"green\": {\n \"tick\": \"yellow\"\n },\n \"yellow\": {\n \"tick\": \"red\"\n }\n }\n}","x":280,"y":200,"wires":[["933aaac9.68d598","eeeeddd0.fb6d4","6ef5c626.d42a08"]]},{"id":"b9d973d8.bc3a4","type":"inject","z":"632239a.6b393c8","name":"Trigger","topic":"tick","payload":"","payloadType":"date","repeat":"5","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":100,"wires":[[]]},{"id":"95a15a62.9e65c8","type":"comment","z":"632239a.6b393c8","name":"Traffic lights _______________________________________","info":"","x":240,"y":20,"wires":[]},{"id":"933aaac9.68d598","type":"dsm","z":"632239a.6b393c8","name":"","sm_config":"{\n \"methods\": {\n \"onTransition\": \"output=true;if(msg.payload==='red'||msg.payload==='red-yellow') {msg.payload=1;sta.fill='red';} else {msg.payload=0;sta.fill='grey';}\",\n \"status\": {\n \"shape\": \"dot\",\n \"text\": {\n \"get\": \"msg.payload\"\n }\n }\n }\n}","x":470,"y":100,"wires":[["75beb9c9.85eb08","e7527bb2.fb0458"]]},{"id":"eeeeddd0.fb6d4","type":"dsm","z":"632239a.6b393c8","name":"","sm_config":"{\n \"methods\": {\n \"onTransition\": \"output=true;if(msg.payload==='yellow'||msg.payload==='red-yellow') {msg.payload=1;sta.fill='yellow';} else {msg.payload=0;sta.fill='grey';}\",\n \"status\": {\n \"shape\": \"dot\",\n \"text\": {\n \"get\": \"msg.payload\"\n }\n }\n }\n}","x":470,"y":220,"wires":[["ce47a283.6881a","2c859c.0bf55a64"]]},{"id":"6ef5c626.d42a08","type":"dsm","z":"632239a.6b393c8","name":"","sm_config":"{\n \"methods\": {\n \"onTransition\": \"output=true;if(msg.payload==='green') {msg.payload=1;sta.fill='green';} else {msg.payload=0;sta.fill='grey';}\",\n \"status\": {\n \"shape\": \"dot\",\n \"text\": {\n \"get\": \"msg.payload\"\n }\n }\n }\n}","x":470,"y":320,"wires":[["6d4ba3ad.f87eac","f89ae6fb.3fe008"]]},{"id":"a6dace16.84fcf","type":"switch","z":"632239a.6b393c8","name":"which button?","property":"payload.event.device_ieee","propertyType":"msg","rules":[{"t":"eq","v":"28:6d:97:00:01:08:59:e2","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":240,"y":400,"wires":[["f61f2674.32fb48","77ca9685.0ba948"]]},{"id":"f61f2674.32fb48","type":"switch","z":"632239a.6b393c8","name":"Wyatt's Bedroom Button","property":"payload.event.command","propertyType":"msg","rules":[{"t":"eq","v":"button_single","vt":"str"},{"t":"eq","v":"button_double","vt":"str"},{"t":"eq","v":"button_hold","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":450,"y":400,"wires":[["51951b02.b11884","2c8e1d40.ba0312"],["e31cfe3d.25302"],[]]},{"id":"ea5b0d75.533f8","type":"server-events","z":"632239a.6b393c8","name":"zha_event","server":"26956a45.92d866","event_type":"zha_event","x":80,"y":400,"wires":[["a6dace16.84fcf","c2ec66ec.d866f8"]]},{"id":"77ca9685.0ba948","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":350,"y":480,"wires":[]},{"id":"c2ec66ec.d866f8","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":150,"y":480,"wires":[]},{"id":"51951b02.b11884","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":520,"wires":[]},{"id":"2c8e1d40.ba0312","type":"change","z":"632239a.6b393c8","name":"tick","rules":[{"t":"set","p":"topic","pt":"msg","to":"tick","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":90,"y":300,"wires":[["518e31ca.83e31","3e26b6d9.0745fa"]]},{"id":"518e31ca.83e31","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":270,"y":300,"wires":[]},{"id":"75beb9c9.85eb08","type":"api-call-service","z":"632239a.6b393c8","name":"Red","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"light.hue_go_1","data":"{\"brightness_pct\":100,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":100,"wires":[["890d4f6e.f978e"]]},{"id":"ce47a283.6881a","type":"api-call-service","z":"632239a.6b393c8","name":"Pink","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"light.hue_go_1","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":220,"wires":[["73f60f5d.68238"]]},{"id":"6d4ba3ad.f87eac","type":"api-call-service","z":"632239a.6b393c8","name":"Green","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"light.hue_go_1","data":"{\"brightness_pct\":100,\"transition\":1.5,\"rgb_color\":[0,128,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":320,"wires":[["4dba1c1c.3a6794"]]},{"id":"2c859c.0bf55a64","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":180,"wires":[]},{"id":"f89ae6fb.3fe008","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":280,"wires":[]},{"id":"e7527bb2.fb0458","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":60,"wires":[]},{"id":"73f60f5d.68238","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":220,"wires":[]},{"id":"4dba1c1c.3a6794","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":320,"wires":[]},{"id":"890d4f6e.f978e","type":"debug","z":"632239a.6b393c8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":100,"wires":[]},{"id":"e31cfe3d.25302","type":"api-current-state","z":"632239a.6b393c8","name":"Wyatt's lamp on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.hue_go_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":770,"y":420,"wires":[["cda6bf69.0cef7"],[]]},{"id":"cda6bf69.0cef7","type":"api-call-service","z":"632239a.6b393c8","name":"Turn off","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"light.hue_go_1","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":940,"y":420,"wires":[[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]