Closed Nancho1950 closed 3 years ago
¡Hecho!
Hola a todos, @domoticafacilconjota aquí mi aportación de dejar el pulsador presionado y que aumente o disminuya el brillo de la bombilla, en mi caso el pulsador si da mensajes al dejarlo presionado y de ahi tomar un acción como la de "brightness_step"...
En mi caso utilice el dimmer de Phillips pero integrado con zigbee2mqtt:
------------- Flow
[{"id":"d587c30a.2a24f","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"8ac5a40d.b77f08","type":"server-state-changed","z":"d587c30a.2a24f","name":"Dimmer Vestidor","server":"9f7cc20f.59af7","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.dimmer_vestidor_action","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":160,"y":260,"wires":[["3bea4a42.6bde86"]]},{"id":"3bea4a42.6bde86","type":"switch","z":"d587c30a.2a24f","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on-press","vt":"str"},{"t":"eq","v":"on-hold","vt":"str"},{"t":"eq","v":"up-press","vt":"str"},{"t":"eq","v":"up-hold","vt":"str"},{"t":"eq","v":"down-press","vt":"str"},{"t":"eq","v":"down-hold","vt":"str"},{"t":"eq","v":"off-press","vt":"str"},{"t":"eq","v":"off-hold","vt":"str"}],"checkall":"true","repair":false,"outputs":8,"x":330,"y":260,"wires":[["ded1cce0.1e224"],["eaea6388.86e59"],["7732c7ed.973bb8"],["22982aa9.255946"],["e0fad094.c6ae6"],["e61ded1c.6b835"],["803c9eca.8e995"],["2c5223c.fcbd7dc"]]},{"id":"ded1cce0.1e224","type":"api-call-service","z":"d587c30a.2a24f","name":"Foco Vestidor","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"light","service":"toggle","entityId":"light.vestidor_light","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":460,"y":140,"wires":[[]]},{"id":"803c9eca.8e995","type":"api-call-service","z":"d587c30a.2a24f","name":"Foco Escaleras ON","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.escaleras_light","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":530,"y":380,"wires":[[]]},{"id":"7732c7ed.973bb8","type":"api-call-service","z":"d587c30a.2a24f","name":"Foco Vestidor Dimm UP","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.vestidor_light","data":"{\"brightness_step\" : 10}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":220,"wires":[[]]},{"id":"22982aa9.255946","type":"api-call-service","z":"d587c30a.2a24f","name":"Foco Vestidor Dimm Down","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.vestidor_light","data":"{\"brightness_step\":-10}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":620,"y":260,"wires":[[]]},{"id":"eaea6388.86e59","type":"api-call-service","z":"d587c30a.2a24f","name":"Foco Baño Papás","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"switch","service":"toggle","entityId":"switch.sonoff_banopapas","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":510,"y":180,"wires":[[]]},{"id":"e0fad094.c6ae6","type":"api-call-service","z":"d587c30a.2a24f","name":"Foco Recamara Ppal","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"switch","service":"toggle","entityId":"switch.sonoff_cuarto_papas","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":600,"y":300,"wires":[[]]},{"id":"2c5223c.fcbd7dc","type":"api-call-service","z":"d587c30a.2a24f","name":"Todo OFF","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.vestidor_light, light.escaleras_light, switch.sonoff_luces_terraza_mama, switch.sonoff_cuarto_papas","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":460,"y":420,"wires":[[]]},{"id":"e61ded1c.6b835","type":"api-call-service","z":"d587c30a.2a24f","name":"Foco Terraza Mamá","server":"9f7cc20f.59af7","version":1,"debugenabled":false,"service_domain":"switch","service":"toggle","entityId":"switch.sonoff_luces_terraza_mama","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":600,"y":340,"wires":[[]]},{"id":"9f7cc20f.59af7","type":"server","name":"Home Assistant","addon":true}]
------- end flow
Explicación de lo que debe hacer el flow en Node RED Controlar el brillo de una ampolleta con un interruptor inalambrico, encender la ampolleta con un simple clip al 50% del brillo, aumentar el brillo con cada simple clip o bien disminuir el brillo con un doble clip y apagarla con un Hold. considerar que el brightness_pct 0 a 100%
Notas del autor Hardware lampara zigbee xiaomi ZNLDP12LM e interruptor inalambrico aqara WXKG11LM