#First Small automation with HA

1 messages ยท Page 1 of 1 (latest)

desert cedar
#

Hi everyone,
I started my jurney with HA just yesterday und spend nearly the most time of the day to get most of my devices to HA. I completed this bsides some devices like Eve Room and Eve Motion. Now to my question:
I have Eve Thermo, Eve Door/Window and Eve Thermo Control installed. I created my first basic automation with trigger Eve door (Open/close), no condition, and result Eve Thermo off/on. This is Working just fine, but I need to advance this. If the Eve Thermo was off before the opening of the window, Eve Thermo should be also off After closing of the Window. In my actual automation thermo is heating up Everytime.
How is it possible to Save the thermo status/temp before open and apply this to the thermo as Well?

In another room and in a second step I want to use the temp of the Eve Thermo Control for Controlling the thermo. But first I want to solve issue 1 ๐Ÿ˜

Cheers

wintry sonnet
#

For that you can use a snapshot scene. When the window is opens you make a snapshot like:

action: scene.create
data:
 snapshot_entities:
   - climate.test
 scene_id: before_window_open

And when you close the window you simply recall that scene:

action: scene.turn_on
target:
  entity_id: scene.before_window_open
data: {}
desert cedar
#

That looks promising, I just need to figure out, how to use the code insgesamt of using the drop downs and how to set up things like helper and entities ๐Ÿ˜
Thank you for your idea

desert cedar
#

This is working very good now. I am wondering, if I do exact the same for another room, do I have to modify anything, so that the script for room A is not using the saved scene from room B, or is this already included in the snapshot_entities?
Do I need to create a scene id for each room? like before_window_open_bath, ..._floor...

desert cedar
#

alias: WZ/EZ Thermo off
description: ""
triggers:

  • type: opened
    device_id: 1
    entity_id:
    domain: binary_sensor
    trigger: device
    for:
    hours: 0
    minutes: 0
    seconds: 0
    conditions:
  • condition: or
    conditions:
    • type: is_open
      condition: device
      device_id: 1
      entity_id:
      domain: binary_sensor
      for:
      hours: 0
      minutes: 0
      seconds: 0
    • type: is_open
      condition: device
      device_id: 2
      entity_id:
      domain: binary_sensor
      for:
      hours: 0
      minutes: 0
      seconds: 0
      actions:
  • action: scene.create
    data:
    snapshot_entities:
    - climate.eve_thermo_3
    - climate.eve_thermo_4
    scene_id: before_window_open
  • device_id: 3
    domain: climate
    entity_id:
    type: set_hvac_mode
    hvac_mode: "off"
  • device_id: 4
    domain: climate
    entity_id:
    type: set_hvac_mode
    hvac_mode: "off"
    mode: single
#

How you added the code?

#

I need another advice:
I have 2 rooms, which I want to control at the same time with thermo+window sensors. Both rooms got 1 thermo and 1 window sensor each.

I created the above code for window sensor 1 and thermo 1. My idea is that if window 1 OR 2 is open, thermo is off (scene saved both thermo states). If Both windows are closed again, each thermo should be using its state previously saved.

#

The code is working fine so far for the windows sensor 1. Do I need to dublicate this code for the second sensor as well by creating a second automation, or is there a smarter way? I dont understand, how to trigger 1 OR 2. If I trigger both, both windows need to be open, which I dont want^^

#

Thermo on again:

alias: WZ/EZ Thermo on
description: ""
triggers:

  • type: not_opened
    device_id: 1
    entity_id:
    domain: binary_sensor
    trigger: device
    for:
    hours: 0
    minutes: 0
    seconds: 0
  • type: not_opened
    device_id: 2
    entity_id:
    domain: binary_sensor
    trigger: device
    for:
    hours: 0
    minutes: 0
    seconds: 0
    conditions: []
    actions:
  • action: scene.turn_on
    target:
    entity_id: scene.before_window_open
    data: {}
    mode: single
desert cedar
#
  1. question. I for now duplicated the thermo off script and added it for the second room. But I now got a problem with the snapshot scene, which makes sense. I open window 1 (scene will get saved for both thermos), thermos are going in off, I open windows 2 and the scene is saved again, which is now off. If I close the windows again, the thermos will stay in off. How can I get rid of this? ๐Ÿ™‚
desert cedar
#

Anyone? ๐Ÿ™‚

jovial condor
#

Blind leading the blind here but... Have you used the UI builder for your automation? There are some widgets for AND, OR and NOT that might help for joining triggers or sensor states. Of course they are available in YAML but I don't know the correct construct, yet.

chrome drift
#

How can I get rid of this?

Make a group of your windows. That will be on when any window is open, and closed when all windows are closed. Trigger scene saving off of this group. Then opening a second window will not do anything.

#

I would not have duplicated the automation as I don't think you want multiple of this. You just want to save your state when any window opens, and restore it once all windows are closed.

desert cedar
desert cedar
jovial condor
desert cedar
#
  • type: opened
    device_id: 2d2236b9dec0f8ad670717533acbaf01
    entity_id: 5b1f9d89527c9a91a4ea53586c4ac5c1
    domain: binary_sensor
    trigger: device
    for:
    hours: 0
    minutes: 0
    seconds: 0
    enabled: true
    conditions:
    • condition: or
      conditions:
      • type: is_open
        condition: device
        device_id: 60bb2c2587fdea91aea9e59c30a36408
        entity_id: e616ccade752001fd2b5f4ad8b74a401
        domain: binary_sensor
        for:
        hours: 0
        minutes: 0
        seconds: 0
      • type: is_open
        condition: device
        device_id: 2d2236b9dec0f8ad670717533acbaf01
        entity_id: 5b1f9d89527c9a91a4ea53586c4ac5c1
        domain: binary_sensor
        for:
        hours: 0
        minutes: 0
        seconds: 0
        enabled: true
        actions:
    • action: scene.create
      data:
      snapshot_entities:
      - climate.eve_thermo_20ebp1701_4
      - climate.eve_thermo_20ebp1701_6
      scene_id: before_window_open
    • device_id: d034084a959e9efb7e7c7ee9f24d68a2
      domain: climate
      entity_id: 78441762307950e826b5581a4eb55014
      type: set_hvac_mode
      hvac_mode: "off"
    • device_id: 7a672624707e3ff459c2c35bf0bf5057
      domain: climate
      entity_id: 72e9cb19a8d815ed0e6e3fe8fac90073
      type: set_hvac_mode
      hvac_mode: "off"
      mode: single
#

This code is working fine for trigger window 1, but not for the second window. (I guess because the second window isnt a trigger) I need to implement if trigger 1 OR 2 opens, then do xyz. I dont know how. Could you help?

jovial condor
#

I am new at this too. It looks like you could create two automations, one for each of your triggers then start a third event with your desired common action from each of those. I havenโ€™t tried but googling and Google Gemini offered some suggestions. You will have to think about what happens if a second trigger occurs while the first has started. Also have you tried asking over at Reddit? I have had better success at responses there than Discord.

jovial condor
#

Maybe we are overthinking this. Here is an example from Gemini that shows multiple triggers in the trigger section - a motion sensor or time of 7:00. I haven't tested though.
automation:

  • alias: Multiple Trigger Automation
    trigger:
    • platform: state
      entity_id: binary_sensor.motion_sensor_living_room
      to: 'on'
    • platform: time
      at: '07:00:00'
      condition:
    • condition: state
      entity_id: input_boolean.vacation_mode
      state: 'off'
      action:
    • service: light.turn_on
      entity_id: light.living_room_light
desert cedar
#

I dont get a solution yet. But now my other automation are crapped too and I dont now why ๐Ÿ˜„ I got headache, man.