diff options
author | lassulus <lassulus@lassul.us> | 2020-11-23 11:33:23 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2020-11-23 11:33:23 +0100 |
commit | 1b4d1c4aaba003f42a542ce1cf442a4983f50194 (patch) | |
tree | ef6e88ffcd5f036fa31086e119fa25b7a4c98874 /makefu/2configs/bureautomation/multi/matrix.nix | |
parent | 801ea60c3a31db7600d004697d4520b636f3c0df (diff) | |
parent | b26b6c4ccedfc6f92193dd7386e382d0bf88a293 (diff) |
Merge remote-tracking branch 'gum/master' into master
Diffstat (limited to 'makefu/2configs/bureautomation/multi/matrix.nix')
-rw-r--r-- | makefu/2configs/bureautomation/multi/matrix.nix | 106 |
1 files changed, 55 insertions, 51 deletions
diff --git a/makefu/2configs/bureautomation/multi/matrix.nix b/makefu/2configs/bureautomation/multi/matrix.nix index 4fcfe8da4..b9b8fc4e8 100644 --- a/makefu/2configs/bureautomation/multi/matrix.nix +++ b/makefu/2configs/bureautomation/multi/matrix.nix @@ -8,58 +8,62 @@ # name: my_command let mom_room = "!kTQjvTQvfVsvfEtmth:thales.citadel.team"; -in { - matrix = +in +{ + services.home-assistant.config = { - # secrets: - # homeserver, username, password - homeserver = "https://ext01.citadel.team"; - rooms = [ - mom_room - ]; - commands = [ - { - # alternative: expression for regexp - word = "version"; - name = "version"; - } - { - word = "luftqualität"; - name = "luftqualitaet"; - } - ]; - } // (builtins.fromJSON (builtins.readFile - <secrets/hass/citadel-bot.json>)); - automation = [ + matrix = { - alias = "React to !version"; - trigger = { - platform = "event"; - event_type = "matrix_command"; - event_data.command = "version"; - }; - action = { - service = "notify.matrix_notify"; - data_template.message = "Running home-assistant {{states.sensor.current_version.state}}"; - }; - } - { - alias = "React to !luftqualität"; - trigger = { - platform = "event"; - event_type = "matrix_command"; - event_data.command = "luftqualitaet"; - }; - action = { - service = "notify.matrix_notify"; - data_template.message = ''Temp: {{states.sensor.notizen_temperature.state_with_unit | replace (" ","")}}, Hum:{{states.sensor.notizen_humidity.state_with_unit | replace (" ","")}}, airquality:{{states.sensor.air_quality.state_with_unit}}''; - }; - } + # secrets: + # homeserver, username, password + homeserver = "https://ext01.citadel.team"; + rooms = [ + mom_room + ]; + commands = [ + { + # alternative: expression for regexp + word = "version"; + name = "version"; + } + { + word = "luftqualität"; + name = "luftqualitaet"; + } + ]; + } // (builtins.fromJSON (builtins.readFile + <secrets/hass/citadel-bot.json>)); + automation = [ + { + alias = "React to !version"; + trigger = { + platform = "event"; + event_type = "matrix_command"; + event_data.command = "version"; + }; + action = { + service = "notify.matrix_notify"; + data_template.message = "Running home-assistant {{states.sensor.current_version.state}}"; + }; + } + { + alias = "React to !luftqualität"; + trigger = { + platform = "event"; + event_type = "matrix_command"; + event_data.command = "luftqualitaet"; + }; + action = { + service = "notify.matrix_notify"; + data_template.message = ''Temp: {{states.sensor.notizen_temperature.state_with_unit | replace (" ","")}}, Hum:{{states.sensor.notizen_humidity.state_with_unit | replace (" ","")}}, airquality:{{states.sensor.air_quality.state_with_unit}}''; + }; + } - ]; - notify = [{ - name = "matrix_notify"; - platform = "matrix"; - default_room = mom_room; - }]; + ]; + notify = [{ + name = "matrix_notify"; + platform = "matrix"; + default_room = mom_room; + }]; + }; } |