Set state to default of set to the same as it is


To the left: input_select.zigbee_30_lightning_effects
This can have/send the followinf payload:

  • No Effect
  • Slow Colorloop
  • Fast Colorloop
  • Flashing Colors

I want input_select.zigbee_30_lightning_effects to change state to “No Effect” it a duplicate effect is sent.
Like if “Slow Colorloop” is selected when “Slow Colorloop” is already selected it should change to “No Effect”

How can this be done?

I assume you are using the input_select.select_option service to choose your options, right?

If so, this should work

[{"id":"b3bb667b.8ad2b8","type":"server-events","z":"74e4c309.282f6c","name":"","server":"9405c3fe.d0a6c","event_type":"call_service","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":190,"y":260,"wires":[["776ce1c9.88161"]]},{"id":"23130fb1.ec2fb","type":"switch","z":"74e4c309.282f6c","name":"Duplicated?","property":"payload.event.service_data.option","propertyType":"msg","rules":[{"t":"eq","v":"inputState","vt":"msg"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":730,"y":260,"wires":[["97d9776b.a15f08"],["2d2c44bc.79a97c"]]},{"id":"933d84c4.d703f8","type":"api-current-state","z":"74e4c309.282f6c","name":"Get Input State","server":"9405c3fe.d0a6c","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.zigbee_30_lightning_effects","state_type":"str","state_location":"inputState","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":true,"x":560,"y":260,"wires":[["23130fb1.ec2fb"]]},{"id":"97d9776b.a15f08","type":"api-call-service","z":"74e4c309.282f6c","name":"to \"No Effect\"","server":"9405c3fe.d0a6c","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.zigbee_30_lightning_effects","data":"{\"option\": \"No Effect\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":220,"wires":[[]]},{"id":"2d2c44bc.79a97c","type":"switch","z":"74e4c309.282f6c","name":"switch Actions","property":"inputState","propertyType":"msg","rules":[{"t":"eq","v":"No Effect","vt":"str"},{"t":"eq","v":"Slow Colorloop","vt":"str"},{"t":"eq","v":"Fast Colorloop","vt":"str"},{"t":"eq","v":"Flashing Colors","vt":"str"}],"checkall":"false","repair":false,"outputs":4,"x":1080,"y":260,"wires":[[],[],[],[]]},{"id":"776ce1c9.88161","type":"switch","z":"74e4c309.282f6c","name":"","property":"payload.event.domain","propertyType":"msg","rules":[{"t":"eq","v":"input_select","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":315,"y":260,"wires":[["8814bfaa.05f96"]],"l":false},{"id":"8814bfaa.05f96","type":"switch","z":"74e4c309.282f6c","name":"","property":"payload.event.service","propertyType":"msg","rules":[{"t":"eq","v":"select_option","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":375,"y":260,"wires":[["f4a25a7.66f11a8"]],"l":false},{"id":"f4a25a7.66f11a8","type":"switch","z":"74e4c309.282f6c","name":"","property":"payload.event.service_data.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"input_select.zigbee_30_lightning_effects","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":435,"y":260,"wires":[["933d84c4.d703f8"]],"l":false},{"id":"9405c3fe.d0a6c","type":"server","name":"Home Assistant","addon":true}]