diff --git a/automations.yaml b/automations.yaml index 974e18c..adfcb8d 100644 --- a/automations.yaml +++ b/automations.yaml @@ -357,3 +357,78 @@ target: entity_id: climate.nilan mode: single +- id: '1683868851491' + alias: Genvex Styrring Sommer + description: '' + trigger: + - type: carbon_dioxide + platform: device + device_id: b3d673e702e87dccc047a7ed97c83331 + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + domain: sensor + below: 700 + - type: carbon_dioxide + platform: device + device_id: b3d673e702e87dccc047a7ed97c83331 + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + domain: sensor + below: 1000 + above: 700 + - type: carbon_dioxide + platform: device + device_id: b3d673e702e87dccc047a7ed97c83331 + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + domain: sensor + below: 1200 + above: 1000 + - type: carbon_dioxide + platform: device + device_id: b3d673e702e87dccc047a7ed97c83331 + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + domain: sensor + above: 1200 + condition: [] + action: + - if: + - condition: numeric_state + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + below: 700 + then: + - service: climate.set_fan_mode + data: + fan_mode: '2' + target: + entity_id: climate.nilan + - if: + - condition: numeric_state + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + below: 1000 + above: 700 + then: + - service: climate.set_fan_mode + data: + fan_mode: '3' + target: + entity_id: climate.nilan + - if: + - condition: numeric_state + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + above: 1000 + below: 1200 + then: + - service: climate.set_fan_mode + data: + fan_mode: '4' + target: + entity_id: climate.nilan + - if: + - condition: numeric_state + entity_id: sensor.netatmo_simstrup_weather_indoor_co2 + above: 1200 + then: + - service: climate.set_fan_mode + data: + fan_mode: '4' + target: + entity_id: climate.nilan + mode: single diff --git a/esphome/nilan300.yaml b/esphome/nilan300.yaml index 356489e..9810a8c 100644 --- a/esphome/nilan300.yaml +++ b/esphome/nilan300.yaml @@ -77,14 +77,37 @@ address: 101 bitmask: 1 + +# - platform: modbus_controller +# modbus_controller_id: nilan_modbus_controller +# name: "Bypass IsOpen" +# id: nilan_bypass_isopen +# register_type: read +# address: 3000 +# bitmask: 1 + + - platform: template + id: nilan_bypass_state + name: Bypass state + device_class: opening + - platform: modbus_controller modbus_controller_id: nilan_modbus_controller - name: "Bypass IsOpen" - id: nilan_bypass_isopen - register_type: read - address: 3000 - bitmask: 1 - + id: nilan_bypass_open_request + register_type: holding + address: 102 + on_state: + - lambda: !lambda |- + id(nilan_bypass_state).publish_state(true); + + - platform: modbus_controller + modbus_controller_id: nilan_modbus_controller + id: nilan_bypass_close_request + register_type: holding + address: 103 + on_state: + - lambda: !lambda |- + id(nilan_bypass_state).publish_state(false); sensor: - platform: uptime name: "Nilan 300 Uptime" diff --git a/scripts.yaml b/scripts.yaml index 6dd4231..0967ef4 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -1,80 +1 @@ -mibox_right: - alias: MiBox Right Arrow - sequence: - - service: androidtv.adb_command - target: - entity_id: media_player.mibox - data: - command: sendevent /dev/input/event2 4 4 786501 && sendevent /dev/input/event2 - 1 106 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 - 4 4 786501 && sendevent /dev/input/event2 1 106 0 && sendevent /dev/input/event2 - 0 0 0 -mibox_left: - alias: MiBox Left Arrow - sequence: - - service: androidtv.adb_command - target: - entity_id: media_player.mibox - data: - command: sendevent /dev/input/event2 4 4 786500 && sendevent /dev/input/event2 - 1 105 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 - 4 4 786500 && sendevent /dev/input/event2 1 105 0 && sendevent /dev/input/event2 - 0 0 0 -mibox_up: - alias: MiBox Left Up - sequence: - - service: androidtv.adb_command - target: - entity_id: media_player.mibox - data: - command: sendevent /dev/input/event2 4 4 786498 && sendevent /dev/input/event2 - 1 103 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 - 4 4 786498 && sendevent /dev/input/event2 1 103 0 && sendevent /dev/input/event2 - 0 0 0 -mibox_down: - alias: MiBox Left Down - sequence: - - service: androidtv.adb_command - target: - entity_id: media_player.mibox - data: - command: sendevent /dev/input/event2 4 4 786499 && sendevent /dev/input/event2 - 1 108 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 - 4 4 786499 && sendevent /dev/input/event2 1 108 0 && sendevent /dev/input/event2 - 0 0 0 -mibox_enter: - alias: MiBox Enter - sequence: - - service: androidtv.adb_command - target: - entity_id: media_player.mibox - data: - command: sendevent /dev/input/event2 4 4 786497 && sendevent /dev/input/event2 - 1 353 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 - 4 4 786497 && sendevent /dev/input/event2 1 353 0 && sendevent /dev/input/event2 - 0 0 0 -mibox_back: - alias: MiBox Back - sequence: - - service: androidtv.adb_command - target: - entity_id: media_player.mibox - data: - command: sendevent /dev/input/event2 4 4 786980 && sendevent /dev/input/event2 - 1 158 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 - 4 4 786980 && sendevent /dev/input/event2 1 158 0 && sendevent /dev/input/event2 - 0 0 0 -mibox_home: - alias: MiBox Home - sequence: - - service: androidtv.adb_command - target: - entity_id: media_player.mibox - data: - command: sendevent /dev/input/event2 4 4 786979 && sendevent /dev/input/event2 - 1 172 1 && sendevent /dev/input/event2 0 0 0 && sendevent /dev/input/event2 - 4 4 786979 && sendevent /dev/input/event2 1 172 0 && sendevent /dev/input/event2 - 0 0 0 -'1661619001115': - alias: Nyt script - sequence: [] +{}