From bccb2fd4e51448a2e9794acd47e7df16339f64aa Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 17 Apr 2019 20:46:58 +0200 Subject: ma bureautomation: refactor --- .../bureautomation/automation/hass-restart.nix | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 makefu/2configs/bureautomation/automation/hass-restart.nix (limited to 'makefu/2configs/bureautomation/automation/hass-restart.nix') diff --git a/makefu/2configs/bureautomation/automation/hass-restart.nix b/makefu/2configs/bureautomation/automation/hass-restart.nix new file mode 100644 index 00000000..be16f696 --- /dev/null +++ b/makefu/2configs/bureautomation/automation/hass-restart.nix @@ -0,0 +1,31 @@ +[ + { alias = "State on HA start-up"; + trigger = { + platform = "homeassistant"; + event = "start"; + }; + action = [ + # Startup State + { service = "mqtt.publish"; + data = { + topic = "/bam/sonoffs/cmnd/state"; + payload = ""; + }; + } + # Firmware Version + { service = "mqtt.publish"; + data = { + topic = "/bam/sonoffs/cmnd/status"; + payload = "2"; + }; + } + # Will trigger restart of all devices! + #{ service = "mqtt.publish"; + # data = { + # topic = "sonoffs/cmnd/SetOption59"; # configure sending state on power change + # payload = "1"; + # }; + #} + ]; + } +] -- cgit v1.2.3