HA-Share / automations_2023_08-26.yaml
automations_2023_08-26.yaml
Raw
- id: tiskipoyta_off
  alias: Yövalo keittiö OFF Ajastin
  trigger:
  - entity_id: light.valo_tiskipoyta
    for: '120'
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: switch.valo_keittiotaso
    state: 'off'
  - condition: state
    entity_id: binary_sensor.tiskikone_pois
    state: 'on'
  action:
  - data:
      entity_id: light.valo_tiskipoyta
    service: homeassistant.turn_off
- id: '1554654657326'
  alias: Valot Olohuone ON
  trigger:
  - entity_id: switch.valo_olohuone1
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      entity_id: switch.valo_olohuone2
    service: homeassistant.turn_on
- id: '1554655220915'
  alias: Valot Olohuone OFF
  trigger:
  - entity_id: switch.valo_olohuone1
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      entity_id: switch.valo_olohuone2
    service: homeassistant.turn_off
- id: '1554655660087'
  alias: Valot TV-Huone ON
  trigger:
  - entity_id: switch.valo_tv_huone1
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
      - switch.auton_lammitys
- id: '1554655754231'
  alias: Valot TV-Huone OFF
  trigger:
  - entity_id: switch.valo_tv_huone1
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - data: {}
    service: homeassistant.turn_off
    target:
      entity_id:
      - switch.auton_lammitys
- id: Theme
  alias: Set theme at startup
  initial_state: 'on'
  trigger:
  - platform: homeassistant
    event: start
  action:
    service: frontend.set_theme
    data:
      name: transparent
- id: '1568907363945'
  alias: Hiirenkarkoitin ON
  trigger:
  - at: '22:30'
    platform: time
  - at: '23:15'
    platform: time
  - at: '23:30'
    platform: time
  - at: 0:00
    platform: time
  - at: 0:15
    platform: time
  - at: 0:30
    platform: time
  - at: '1:00'
    platform: time
  - at: '22:45'
    platform: time
  - at: '23:00'
    platform: time
  condition:
  - condition: state
    entity_id: switch.valo_olohuone1
    state: 'off'
  - condition: state
    entity_id: switch.valo_olohuonekatto
    state: 'off'
  - condition: state
    entity_id: switch.valo_tv_huone1
    state: 'off'
  - after: '22:00'
    before: '6:00'
    condition: time
  action:
  - data:
      entity_id: switch.hiirenkarkoitin
    service: switch.turn_on
  mode: single
- id: '1568907926942'
  alias: Hiirenkarkoitin OFF
  trigger:
  - at: '6:00'
    platform: time
  - entity_id: switch.valo_olohuone1
    for: '5'
    from: 'off'
    platform: state
    to: 'on'
  - entity_id: switch.shelly1_227bc4_relay_0
    for: '5'
    from: 'off'
    platform: state
    to: 'on'
  - entity_id: switch.valo_olohuonekatto
    for: '5'
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: homeassistant.turn_off
    target:
      entity_id: switch.hiirenkarkoitin
  mode: single
- id: '1576417292155'
  alias: Yövalo keittiö ON
  description: ''
  trigger:
  - entity_id:
    - binary_sensor.liike_keittio
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: switch.valo_keittiotaso
    state: 'off'
  - condition: state
    entity_id: switch.shellyswitch_5a5092_relay_0
    state: 'off'
  - condition: state
    entity_id: sun.sun
    state: below_horizon
  action:
  - data:
      brightness: 1
      effect: 0
      rgb_color:
      - 0
      - 0
      - 0
      white_value: 30
    service: light.turn_on
    target:
      entity_id: light.valo_tiskipoyta
  mode: single
- id: '1576423893940'
  alias: Pyykinpesutorni Valmis
  description: ''
  trigger:
  - entity_id: binary_sensor.pyykinpesutorni_valmis
    platform: state
    to: 'on'
    for: '15'
  condition: []
  action:
  - data:
      brightness: 100
      rgb_color:
      - 0
      - 255
      - 0
      transition: 50
    service: light.turn_on
    target:
      entity_id: light.merkkivalo
  mode: single
- id: '1576423995641'
  alias: Pyykinpesutorni Pois
  description: ''
  trigger:
  - entity_id: binary_sensor.liike_kodinhoito
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: binary_sensor.pyykinpesutorni_pois
    state: 'on'
  action:
  - data: {}
    service: homeassistant.turn_off
    target:
      entity_id: light.merkkivalo
  mode: single
- id: '1576425439784'
  alias: Pyykinpesutorni Päällä
  description: ''
  trigger:
  - entity_id: binary_sensor.pyykinpesutorni_kaynnissa
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness: 50
      rgb_color:
      - 230
      - 126
      - 0
      transition: 50
    service: light.turn_on
    target:
      entity_id: light.merkkivalo
  mode: single
- id: tiskikone_valmis
  alias: Tiskikone Valmis
  description: ''
  trigger:
  - entity_id: binary_sensor.tiskikone_valmis
    for: '300'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness: 50
      rgb_color:
      - 0
      - 255
      - 0
      transition: 50
    entity_id: light.valo_tiskipoyta
    service: light.turn_on
  mode: single
- id: tiskikone_pois
  alias: Tiskikone Pois
  description: ''
  trigger:
  - entity_id: binary_sensor.tiskikone_pois
    for: '15'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness: 1
      rgb_color:
      - 0
      - 0
      - 0
      transition: 50
      white_value: 0
    entity_id: light.valo_tiskipoyta
    service: light.turn_on
- id: tiskikone_paalla
  alias: Tiskikone Päällä
  description: ''
  trigger:
  - entity_id: binary_sensor.tiskikone_kaynnissa
    for: '15'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness: 1
      rgb_color:
      - 255
      - 90
      - 0
      transition: 50
    entity_id: light.valo_tiskipoyta
    service: light.turn_on
- id: '1576860415257'
  alias: Sisääntulo valot
  description: ''
  trigger:
  - entity_id:
    - binary_sensor.ulko_ovi
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: binary_sensor.liike_eteinen
    state: 'off'
  - condition: numeric_state
    entity_id: sensor.olohuone_lux
    below: 50
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
      - switch.shelly1_224f5a_relay_0
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
      - switch.shelly1_22f33d_relay_0
  mode: single
- id: '1577042945068'
  alias: Tuulikaapinvalot OFF
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.liike_eteinen
    for:
      hours: 0
      minutes: 10
      seconds: 0
    to: 'off'
  condition:
  - condition: state
    entity_id: binary_sensor.liike_eteinen
    state: 'off'
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
      - switch.shelly1_224f5a_relay_0
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
      - switch.shelly1_22f33d_relay_0
  mode: single
- id: '1577091054727'
  alias: Eteisen valot pois
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.liike_eteinen
    to: 'off'
    for:
      hours: 0
      minutes: 10
      seconds: 0
  condition:
  - condition: state
    entity_id: binary_sensor.liike_eteinen
    state: 'off'
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id:
      - switch.shelly1_22f33d_relay_0
  mode: single
- id: '1577902549944'
  alias: ZZZ kytkin ON
  description: ''
  trigger:
  - entity_id: switch.zzz_kytkin
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: script.nukkumaan_no_delay
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - data: {}
    entity_id: switch.zzz_kytkin
    service: switch.turn_off
  mode: single
- id: '1577979577409'
  alias: Vesivuoto Hälytys
  description: ''
  trigger:
  - entity_id: binary_sensor.watersensor1
    for: '5'
    platform: state
    to: 'on'
  - entity_id: binary_sensor.watersensor2
    for: '5'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness: 100
      rgb_color:
      - 255
      - 0
      - 0
      transition: 50
    entity_id: light.shellybulb_a610a2_light_0
    service: light.turn_on
  - data:
      brightness: 1
      rgb_color:
      - 255
      - 0
      - 0
      transition: 50
    entity_id: light.valo_tiskipoyta
    service: light.turn_on
  - service: notify.mobile_app_kb2003
    data:
      message: Vesivuotohälytys!
      title: ALERT
  mode: single
- id: '1580496820245'
  alias: Keittiön Valot ON
  description: ''
  trigger:
  - entity_id:
    - switch.shellyswitch_5a5092_relay_0
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data: {}
    service: switch.turn_on
    target:
      entity_id: switch.valo_keittiotaso
  mode: single
- id: '1580496981083'
  alias: Keittiö Valo OFF
  description: ''
  trigger:
  - entity_id:
    - switch.shellyswitch_5a5092_relay_0
    for:
      hours: 0
      minutes: 0
      seconds: 0
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.valo_keittiotaso
  mode: single
- id: '1580567682147'
  alias: SonosBeam NightMode ON
  description: ''
  trigger:
  - platform: numeric_state
    below: '0.06'
    entity_id: media_player.tv_huone
    attribute: volume_level
  condition: []
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.sonos_tv_huone_night_sound
- id: '1580568207536'
  alias: SonosBeam NightMode OFF
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: media_player.tv_huone
    above: '0.1'
    attribute: volume_level
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.sonos_tv_huone_night_sound
- id: '1583616683774'
  alias: ZZZ reset
  description: ''
  trigger:
  - minutes: /1
    platform: time_pattern
  condition: []
  action:
  - data: {}
    entity_id: switch.zzz_kytkin
    service: switch.turn_off
- id: '1587961240995'
  alias: Tiskipöydän valo POIS
  description: ''
  trigger:
  - minutes: '15'
    platform: time_pattern
  condition:
  - condition: and
    conditions:
    - condition: state
      entity_id: binary_sensor.liike_keittio
      state: 'off'
    - condition: state
      entity_id: sensor.tiskikone_status
      state: Pois päältä
  action:
  - data: {}
    entity_id: light.valo_tiskipoyta
    service: light.turn_off
  mode: single
- id: '1592161165449'
  alias: Valot TV-Huone_LUX&TV
  description: ''
  trigger:
  - platform: numeric_state
    below: '30'
    entity_id: sensor.olohuone_lux
    enabled: true
  - platform: sun
    event: sunset
    offset: -01:00:00
  condition:
  - condition: state
    entity_id: media_player.samsung_qn85ba_55
    state: 'on'
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.valo_tv_huone1
  mode: single
- id: '1592161436222'
  alias: Valot TV-Huone_TV
  description: ''
  trigger:
  - platform: state
    entity_id:
    - media_player.samsung_qn85ba_55
    to: 'on'
    from: 'off'
  condition:
  - below: '30'
    condition: numeric_state
    entity_id: sensor.olohuone_lux
    enabled: false
  - condition: sun
    after: sunset
    after_offset: '-1'
  action:
  - data: {}
    entity_id: switch.valo_tv_huone1
    service: homeassistant.turn_on
  mode: single
- id: '1596473159182'
  alias: Valot Olohuone LUX
  description: ''
  trigger:
  - entity_id:
    - binary_sensor.liike_olohuone
    platform: state
    to: 'on'
  condition:
  - condition: time
    after: 07:30
    before: '21:30:00'
  - condition: sun
    before: sunrise
    before_offset: 02:00:00
    after: sunset
    after_offset: -02:00:00
    enabled: true
  - condition: numeric_state
    entity_id: sensor.olohuone_lux
    below: 30
  action:
  - data: {}
    service: homeassistant.turn_on
    target:
      entity_id:
      - switch.valo_olohuone1
      - switch.valo_olohuone2
  mode: single
- id: '1596559915199'
  alias: Valot TV-Huone LUX&LIIKE OFF
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.liike_tv_huone
    for:
      hours: 1
      minutes: 0
      seconds: 0
    from: 'on'
    to: 'off'
  - platform: numeric_state
    entity_id: sensor.olohuone_lux
    above: 50
  condition:
  - condition: state
    entity_id: media_player.samsung_qn85ba_55
    state: 'off'
  action:
  - service: homeassistant.turn_off
    target:
      entity_id: switch.valo_tv_huone1
    data: {}
  mode: single
- id: '1603138219582'
  alias: Kattilan hälytys
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.kattila_temperature_temperature
    below: 40
    for:
      hours: 0
      minutes: 20
      seconds: 0
  condition: []
  action:
  - service: notify.mobile_app_iphone_kimmo
    data:
      message: Kattila hälytys
  mode: single
- id: '1603629083815'
  alias: Tuulikaapin Valo ON
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.liike_eteinen
    to: 'on'
  condition:
  - condition: state
    entity_id: binary_sensor.ulko_ovi
    state: 'off'
  - condition: numeric_state
    entity_id: sensor.olohuone_lux
    below: 50
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
      - switch.shelly1_224f5a_relay_0
      - switch.shelly1_22f33d_relay_0
  mode: restart
- id: '1612095873043'
  alias: Valot Olohuone LUX OFF
  description: ''
  trigger:
  - platform: numeric_state
    for:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 0
    entity_id: sensor.olohuone_lux
    above: '30'
  - platform: time_pattern
    minutes: /30
  condition:
  - condition: sun
    after: sunrise
    after_offset: 01:00:00
    before: sunset
    before_offset: -02:00:00
  - condition: numeric_state
    entity_id: sensor.olohuone_lux
    above: 50
  action:
  - data: {}
    service: homeassistant.turn_off
    target:
      entity_id:
      - switch.valo_olohuone1
      - switch.valo_olohuone2
  mode: single
- id: '1616170017457'
  alias: Valot TV-Huone_LUX&LIIKE
  description: ''
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.liike_tv_huone
    to: 'on'
    from: 'off'
  condition:
  - condition: time
    after: 07:30
    before: '21:00'
  - condition: numeric_state
    entity_id: sensor.olohuone_lux
    below: 30
  action:
  - data: {}
    service: homeassistant.turn_on
    target:
      entity_id:
      - switch.valo_tv_huone1
      - switch.valo_olohuone2
  mode: single
- id: '1623864653608'
  alias: Kattila vastus ON
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /5
  - platform: numeric_state
    entity_id: sensor.hourly_energy
    below: '-0.4'
  condition:
  - condition: numeric_state
    entity_id: sensor.kattila_temperature_temperature
    below: '79'
    above: '30'
  - condition: numeric_state
    entity_id: sensor.hourly_energy
    below: -0.35
  - condition: not
    conditions:
    - condition: numeric_state
      entity_id: sensor.goecharger_go_echarger_042248_p_all
      above: 3.7
  - condition: numeric_state
    entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
    below: 12
  action:
  - type: turn_on
    device_id: 618d660c69c1ed2021807533fc5ddc79
    entity_id: switch.lammitysjarjestelma_switch_0
    domain: switch
  mode: single
- id: '1623865912634'
  alias: Kattila vastus OFF lämpötila
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.kattila_temperature_temperature
    above: '80'
  condition: []
  action:
  - type: turn_off
    device_id: 618d660c69c1ed2021807533fc5ddc79
    entity_id: switch.lammitysjarjestelma_switch_0
    domain: switch
  mode: single
- id: '1623869687332'
  alias: Kattila vastus OFF kulutus
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.hourly_energy
    above: '0'
  condition: []
  action:
  - type: turn_off
    device_id: 618d660c69c1ed2021807533fc5ddc79
    entity_id: switch.lammitysjarjestelma_switch_0
    domain: switch
  mode: single
- id: '1623869744260'
  alias: Kattila vastus OFF hinta
  description: ''
  trigger:
  - platform: numeric_state
    for:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
    entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
    above: 12
  condition: []
  action:
  - type: turn_off
    device_id: 618d660c69c1ed2021807533fc5ddc79
    entity_id: switch.lammitysjarjestelma_switch_0
    domain: switch
  mode: single
- id: '1625424373921'
  alias: Auton pikalataus
  description: ''
  trigger:
  - platform: state
    entity_id: switch.t1_wlan_katkaisin
    to: 'on'
  condition:
  - condition: numeric_state
    entity_id: sensor.solarnet_power_grid
    below: 5
  action:
  - service: switch.turn_on
    target:
      entity_id:
      - switch.autolaturi_16a
      - switch.goecharger_go_echarger_042248_allow_charging
    data: {}
  mode: single
- id: '1625425928208'
  alias: Auton pikalataus OFF
  description: ''
  trigger:
  - platform: state
    entity_id:
    - switch.t1_wlan_katkaisin
    from: 'off'
    to: 'on'
    for:
      hours: 5
      minutes: 0
      seconds: 0
  condition: []
  action:
  - service: switch.turn_off
    target:
      entity_id: switch.t1_wlan_katkaisin
    data: {}
  mode: single
- id: '1647711753936'
  alias: Eteinen 1
  description: ''
  trigger:
  - type: powered
    platform: device
    device_id: 6b94539b0a3410c605fa476b16970b67
    entity_id: binary_sensor.shellyplusi4_083af2010a04_input_0_input
    domain: binary_sensor
  condition: []
  action:
  - service: script.nukkumaan_no_delay
    data: {}
  mode: single
- id: '1647712783561'
  alias: Valot alakerta ON
  description: ''
  trigger:
  - type: powered
    platform: device
    device_id: 6b94539b0a3410c605fa476b16970b67
    entity_id: binary_sensor.shellyplusi4_083af2010a04_input_1_input
    domain: binary_sensor
  condition: []
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id:
      - switch.shelly1_22f33d_relay_0
      - switch.shelly1_224f5a_relay_0
      - switch.valo_olohuone1
      - switch.valo_tv_huone1
      - switch.valo_keittiotaso
  mode: single
- id: '1654357178452'
  alias: Auton lataus Solar
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /1
  - platform: numeric_state
    entity_id: sensor.hourly_energy
    below: -0.1
  - platform: time_pattern
    minutes: '12'
  - platform: numeric_state
    entity_id: sensor.hourly_energy
    above: '0.5'
  - platform: time_pattern
    minutes: '27'
  - platform: time_pattern
    minutes: '42'
  - platform: time_pattern
    minutes: '57'
  - platform: numeric_state
    entity_id: sensor.hourly_energy
    below: '-0.3'
  condition:
  - condition: not
    conditions:
    - condition: state
      entity_id: switch.t1_wlan_katkaisin
      state: 'on'
  - condition: state
    entity_id: input_select.charger_mode
    state: Solar
  - condition: or
    conditions:
    - condition: and
      conditions:
      - condition: state
        entity_id: device_tracker.mazda_device_tracker
        state: home
      - condition: state
        entity_id: binary_sensor.mazda_plugged_in
        state: 'on'
    - condition: and
      conditions:
      - condition: state
        entity_id: device_tracker.tmble9ny4nf039390_position
        state: home
      - condition: state
        entity_id: binary_sensor.tmble9ny4nf039390_charging_cable_connected
        state: 'on'
  action:
  - if:
    - condition: numeric_state
      entity_id: sensor.hourly_energy
      below: -0.1
    - condition: numeric_state
      entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
      below: '20'
    - condition: not
      conditions:
      - condition: state
        entity_id: switch.goecharger_go_echarger_042248_allow_charging
        state: 'on'
    then:
    - service: switch.turn_on
      data: {}
      target:
        entity_id: switch.goecharger_go_echarger_042248_allow_charging
    else: []
  - if:
    - condition: numeric_state
      entity_id: sensor.goecharger_go_echarger_042248_p_all
      above: '1'
    - condition: numeric_state
      entity_id: sensor.hourly_energy
      below: 0.5
    - condition: numeric_state
      entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
      below: '20'
    - condition: not
      conditions:
      - condition: and
        conditions:
        - condition: state
          entity_id: device_tracker.mazda_device_tracker
          state: home
        - condition: state
          entity_id: binary_sensor.mazda_plugged_in
          state: 'on'
        - condition: numeric_state
          entity_id: sensor.mazda_remaining_range
          below: 100
    - condition: not
      conditions:
      - condition: and
        conditions:
        - condition: state
          entity_id: device_tracker.tmble9ny4nf039390_position
          state: home
        - condition: state
          entity_id: binary_sensor.tmble9ny4nf039390_charging_cable_connected
          state: 'on'
        - condition: numeric_state
          entity_id: sensor.tmble9ny4nf039390_electric_range
          below: 150
    then:
    - service: script.turn_on
      data: {}
      target:
        entity_id: script.laturi_teho_testi
    else: []
  - if:
    - condition: state
      entity_id: device_tracker.mazda_device_tracker
      state: home
    - condition: state
      entity_id: binary_sensor.mazda_plugged_in
      state: 'on'
    - condition: numeric_state
      entity_id: sensor.mazda_remaining_range
      below: 100
    then:
    - service: switch.turn_on
      data: {}
      target:
        entity_id:
        - switch.goecharger_go_echarger_042248_allow_charging
        - switch.autolaturi_16a
  - if:
    - condition: state
      entity_id: device_tracker.tmble9ny4nf039390_position
      state: home
    - condition: state
      entity_id: binary_sensor.tmble9ny4nf039390_charging_cable_connected
      state: 'on'
    - condition: numeric_state
      entity_id: sensor.tmble9ny4nf039390_electric_range
      below: 150
    then:
    - service: switch.turn_on
      data: {}
      target:
        entity_id:
        - switch.goecharger_go_echarger_042248_allow_charging
        - switch.autolaturi_16a
    enabled: true
  - if:
    - condition: numeric_state
      entity_id: sensor.hourly_energy
      above: 0.5
    - condition: and
      conditions:
      - condition: numeric_state
        entity_id: sensor.mazda_remaining_range
        above: 100
      - condition: state
        entity_id: device_tracker.mazda_device_tracker
        state: home
      - condition: state
        entity_id: binary_sensor.mazda_plugged_in
        state: 'on'
      - condition: numeric_state
        entity_id: sensor.goecharger_go_echarger_042248_p_all
        above: 1
    then:
    - service: switch.turn_off
      data: {}
      target:
        entity_id: switch.goecharger_go_echarger_042248_allow_charging
  - if:
    - condition: numeric_state
      entity_id: sensor.hourly_energy
      above: 0.5
    - condition: and
      conditions:
      - condition: numeric_state
        entity_id: sensor.tmble9ny4nf039390_electric_range
        above: 150
      - condition: state
        entity_id: device_tracker.tmble9ny4nf039390_position
        state: home
      - condition: state
        entity_id: binary_sensor.tmble9ny4nf039390_charging_cable_connected
        state: 'on'
      - condition: numeric_state
        entity_id: sensor.goecharger_go_echarger_042248_p_all
        above: 1
    then:
    - service: switch.turn_off
      data: {}
      target:
        entity_id: switch.goecharger_go_echarger_042248_allow_charging
    enabled: true
  - if:
    - condition: numeric_state
      entity_id: sensor.goecharger_go_echarger_042248_p_all
      above: '1'
    - condition: numeric_state
      entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
      above: 20
    - condition: not
      conditions:
      - condition: and
        conditions:
        - condition: state
          entity_id: device_tracker.mazda_device_tracker
          state: home
        - condition: state
          entity_id: binary_sensor.mazda_plugged_in
          state: 'on'
        - condition: numeric_state
          entity_id: sensor.mazda_remaining_range
          below: 100
    - condition: not
      conditions:
      - condition: and
        conditions:
        - condition: state
          entity_id: device_tracker.tmble9ny4nf039390_position
          state: home
        - condition: state
          entity_id: binary_sensor.tmble9ny4nf039390_charging_cable_connected
          state: 'on'
        - condition: numeric_state
          entity_id: sensor.tmble9ny4nf039390_electric_range
          below: 150
      enabled: false
    then:
    - service: switch.turn_off
      data: {}
      target:
        entity_id: switch.goecharger_go_echarger_042248_allow_charging
    else: []
  mode: single
- id: '1662743860851'
  alias: Autolaturi Medium
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /1
  - platform: state
    entity_id:
    - input_select.charger_mode
    to: Medium (10A)
  condition:
  - condition: not
    conditions:
    - condition: state
      entity_id: switch.t1_wlan_katkaisin
      state: 'on'
  - condition: state
    entity_id: input_select.charger_mode
    state: Medium (10A)
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.autolaturi_10a
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.goecharger_go_echarger_042248_allow_charging
  mode: single
- id: '1668351310687'
  alias: Blueprint - Vacation Lighting
  description: Poissaolovalaistus automaatio
  use_blueprint:
    path: homeassistant/vacation_lighting.yaml
    input:
      vacation_mode_toggle: input_boolean.vacation_mode
      replay_sensor_1: sensor.replay_olohuone
      light_target_1: switch.valo_olohuone1
      replay_sensor_2: sensor.replay_eteinen
      light_target_2: switch.shelly1_224f5a_relay_0
      replay_sensor_3: sensor.replay_eteinen
      light_target_3: switch.shelly1_22f33d_relay_0
      replay_sensor_4: sensor.replay_nukkumaan
      light_target_4: switch.zzz_kytkin
      replay_sensor_5: sensor.replay_olohuone
      light_target_5: switch.valo_tv_huone1
      replay_sensor_6: sensor.replay_aamiaiskaappi
      light_target_6: light.muuntaja
      replay_sensor_7: sensor.replay_olohuone
      light_target_7: switch.valo_olohuonekatto
      replay_sensor_8: sensor.replay_eteinen
      light_target_8: switch.shelly1_227bc4_relay_0
      replay_sensor_9: sensor.replay_olohuone
      light_target_9: switch.valo_olohuone2
      replay_sensor_10: sensor.replay_keittio
      light_target_10: switch.shellyswitch_5a5092_relay_0
      default_brightness: 45
- id: '1677594922543'
  alias: Auton lataus Automatic
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /1
  - platform: state
    entity_id:
    - binary_sensor.mazda_plugged_in
    to: 'on'
  - platform: state
    entity_id:
    - binary_sensor.tmble9ny4nf039390_charging_cable_connected
    to: 'on'
  condition:
  - condition: not
    conditions:
    - condition: state
      entity_id: switch.t1_wlan_katkaisin
      state: 'on'
  - condition: state
    entity_id: input_select.charger_mode
    state: Automatic
  action:
  - if:
    - condition: state
      entity_id: binary_sensor.mazda_plugged_in
      state: 'on'
    - condition: numeric_state
      entity_id: sensor.mazda_remaining_range
      below: 100
    - condition: state
      entity_id: device_tracker.mazda_device_tracker
      state: home
    then:
    - service: switch.turn_on
      data: {}
      target:
        entity_id:
        - switch.autolaturi_16a
  - if:
    - condition: state
      entity_id: binary_sensor.mazda_plugged_in
      state: 'on'
    - condition: numeric_state
      entity_id: sensor.mazda_remaining_range
      above: 100
    - condition: state
      entity_id: device_tracker.mazda_device_tracker
      state: home
    then:
    - service: script.laturi_teho_testi
      data: {}
  - if:
    - condition: state
      entity_id: binary_sensor.tmble9ny4nf039390_charging_cable_connected
      state: 'on'
    - condition: numeric_state
      entity_id: sensor.tmble9ny4nf039390_electric_range
      below: 150
    - condition: state
      entity_id: device_tracker.tmble9ny4nf039390_position
      state: home
    then:
    - service: switch.turn_on
      data: {}
      target:
        entity_id:
        - switch.autolaturi_16a
  - if:
    - condition: state
      entity_id: binary_sensor.tmble9ny4nf039390_charging_cable_connected
      state: 'on'
    - condition: numeric_state
      entity_id: sensor.tmble9ny4nf039390_electric_range
      above: 150
    - condition: state
      entity_id: device_tracker.tmble9ny4nf039390_position
      state: home
    then:
    - service: script.laturi_teho_testi
      data: {}
  - if:
    - condition: not
      conditions:
      - condition: state
        entity_id: switch.goecharger_go_echarger_042248_allow_charging
        state: 'on'
    then:
    - service: switch.turn_on
      data: {}
      target:
        entity_id: switch.goecharger_go_echarger_042248_allow_charging
  mode: single
- id: '1689013152612'
  alias: Lattiakierto OFF
  description: Lattialämmityksen pumppu pois päältä
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.vicare_dhw_charging_active
    from: 'off'
    to: 'on'
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - platform: time_pattern
    minutes: /1
  condition: []
  action:
  - if:
    - condition: state
      entity_id: binary_sensor.vicare_dhw_charging_active
      state: 'on'
    then:
    - service: switch.turn_off
      data: {}
      target:
        entity_id: switch.shellyplus1pm_90380c37a3b0_switch_0
  mode: single
- id: '1689013306585'
  alias: Lattiakierto ON
  description: Lattialämmityksen pumppu päälle
  trigger:
  - platform: state
    entity_id:
    - binary_sensor.vicare_dhw_charging_active
    to: 'off'
    from: 'on'
  - platform: time_pattern
    minutes: /1
  condition:
  - condition: state
    entity_id: binary_sensor.vicare_dhw_charging_active
    state: 'off'
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.shellyplus1pm_90380c37a3b0_switch_0
  mode: single
- id: '1689365133779'
  alias: Puskurivaraajan vastus ON
  description: ''
  trigger:
  - platform: time_pattern
    minutes: /5
  - platform: numeric_state
    entity_id: sensor.hourly_energy
    below: -0.8
  condition:
  - condition: numeric_state
    entity_id: sensor.puskurivaraaja_alalampotila
    below: 40
    above: 10
  - condition: numeric_state
    entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
    below: 0
  - condition: numeric_state
    entity_id: sensor.hourly_energy
    below: -0.8
  - condition: not
    conditions:
    - condition: numeric_state
      entity_id: sensor.goecharger_go_echarger_042248_p_all
      above: 3.7
  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.puskurivaraaja_sahkovastus
  mode: single
- id: '1689365522823'
  alias: Puskurivaraajan vastus OFF kulutus
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.hourly_energy
    above: '0'
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.puskurivaraaja_sahkovastus
  mode: single
- id: '1689365643542'
  alias: Puskurivaraajan vastus OFF lämpötila
  description: ''
  trigger:
  - platform: numeric_state
    entity_id: sensor.puskurivaraaja_alalampotila
    above: 40
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.puskurivaraaja_sahkovastus
  mode: single
- id: '1689365908391'
  alias: Puskurivaraajan vastus OFF hinta
  description: ''
  trigger:
  - platform: numeric_state
    for:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
    entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
    above: 0
  condition: []
  action:
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.puskurivaraaja_sahkovastus
  mode: single
- id: '1689609181910'
  alias: Fronius Limit ON
  description: Rajoita aurinkojärjestelmän tuotto (ei verkkoon syöttöä)
  trigger:
  - platform: time_pattern
    minutes: '1'
  - platform: time_pattern
    minutes: /15
  - platform: state
    entity_id:
    - input_boolean.solar_limit
    from:
    to: 'on'
  condition:
  - condition: numeric_state
    entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
    below: 0
  action:
  - service: modbus.write_register
    data:
      hub: mb_fronius
      address: 40236
      slave: 1
      value: 0
  mode: single
- id: '1689609700818'
  alias: Fronius Limit OFF
  description: Poista aurinkojärjestelmän tuoton rajoitus (salli verkkoon syöttö)
  trigger:
  - platform: time_pattern
    minutes: '1'
  - platform: time_pattern
    minutes: /15
  - platform: state
    entity_id:
    - input_boolean.solar_limit
    from:
    to: 'off'
  condition:
  - condition: numeric_state
    entity_id: sensor.nordpool_kwh_fi_eur_3_10_024
    above: 0
  action:
  - service: modbus.write_register
    data:
      hub: mb_fronius
      address: 40236
      slave: 1
      value: 0
  - service: modbus.write_register
    data:
      hub: mb_fronius
      address: 40232
      slave: 1
      value: 10000
  - service: modbus.write_register
    data:
      hub: mb_fronius
      address: 40236
      slave: 1
      value: 1
  mode: single
- id: '1689621564696'
  alias: Fronius Solar Limit Mode
  description: Aurinkosähkön verkkoonsyötön tilan ohjaus
  trigger:
  - platform: time_pattern
    minutes: /10
  - platform: numeric_state
    entity_id: sensor.reading_power_output_state
    above: 0.5
  - platform: numeric_state
    entity_id: sensor.reading_power_output_state
    below: 0.5
  condition: []
  action:
  - if:
    - condition: numeric_state
      entity_id: sensor.reading_power_output_state
      above: 0.5
    then:
    - service: input_boolean.turn_off
      data: {}
      target:
        entity_id: input_boolean.solar_limit
    else:
    - service: input_boolean.turn_on
      data: {}
      target:
        entity_id: input_boolean.solar_limit
  mode: single