From: David Woodhouse Date: Tue, 5 Sep 2023 21:00:31 +0000 (+0100) Subject: Domoticz notification for mains switches X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=98e78d94b3d6bb7caae8049e4a93866ceeb0f0f9;p=users%2Fdwmw2%2Fesp32-pool.git Domoticz notification for mains switches --- diff --git a/pool.yaml b/pool.yaml index 07c4677..1b649ae 100644 --- a/pool.yaml +++ b/pool.yaml @@ -592,6 +592,22 @@ switch: #### To switch on and off the communication with the BLE device #### pin: number: GPIO15 inverted: true + on_turn_on: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 516; + root["nvalue"] = 1; + on_turn_off: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 516; + root["nvalue"] = 0; - platform: gpio id: pool_pump @@ -599,6 +615,22 @@ switch: #### To switch on and off the communication with the BLE device #### pin: number: GPIO16 inverted: true + on_turn_on: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 518; + root["nvalue"] = 1; + on_turn_off: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 518; + root["nvalue"] = 0; - platform: gpio id: pool_light @@ -606,6 +638,22 @@ switch: #### To switch on and off the communication with the BLE device #### pin: number: GPIO4 inverted: true + on_turn_on: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 515; + root["nvalue"] = 1; + on_turn_off: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 515; + root["nvalue"] = 0; - platform: gpio id: shed_fan @@ -613,3 +661,19 @@ switch: #### To switch on and off the communication with the BLE device #### pin: number: GPIO32 inverted: true + on_turn_on: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 517; + root["nvalue"] = 1; + on_turn_off: + then: + - mqtt.publish_json: + topic: domoticz/in + payload: |- + root["command"] = "udevice"; + root["idx"] = 517; + root["nvalue"] = 0;