#everybody

1 messages · Page 1 of 1 (latest)

candid pecan
#

Then you want a state trigger for each person entity

#
trigger:
- platform: state
  entity_id:
    - person.one
    - person.two
  to: 'home'
#

Your service call will be for switch.turn_on and the switch entity of the SmartThing switch

rough saffron
#

And it will be in action section ?

candid pecan
#

The service call will be

#

The trigger won't

placid oreBOT
#

There are three sections to an automation:

  • trigger: When any one of these becomes true the automation starts processing. Only one trigger is ever responsible for starting an automation, if you make a condition that checks for more than one having started the automation then the condition can never be true.
  • condition: These are checked after a trigger starts the processing, and must be true for the automation to continue.
  • action: This is the part that does something, and can also include further conditions.
candid pecan
#

You can build all this in the UI editor

rough saffron
# candid pecan You can build all this in the UI editor

Ok, i think i figured out and let me know if i wrong, i set in the UI and the config look like this alias: Familly Home
description: Familly Home
trigger:

  • platform: state
    entity_id:
    • device_tracker.alexandre_fraser
      to: home
      condition: []
      action:
  • service: switch.turn_on
    data: {}
    target:
    device_id: 9752f5d2d36886b465f19572dba07019
    mode: single
placid oreBOT
#

@rough saffron When using Discord's Reply feature it defaults to pinging the person you reply to, which can get frustrating for the target. Use Shift + click on the Reply option, or click @ ON to @ OFF to stop this - on the right side of the compose bar.

You have to change this every time (thank the Discord devs for that).

candid pecan
#

The answer is ... try it and see 😉

placid oreBOT
#

To test an automation there's three stages you can follow. Testing the action, the condition and action, and the whole automation:

  1. Use Configuration -> Automations to find the automation and then push Run Actions. If this fails your problem is in the action: section, and details should be found in your log file
  2. Use Developer tools -> Services and call automation.trigger on the automation with skip_condition: false. If the first passes but this fails then the problem is in your condition: block
  3. Use Developer tools -> States to find the trigger entity, click the name, then change the state (at the top) to something that'll trigger the automation before pushing Set State. If this fails then the problem is with your trigger: section, or the automation is turned off (you can check that in Developer tools -> States).

You can also see this section in the docs and with HA 2021.4 onwards debug automations.

rough saffron
candid pecan
#

@rough saffron you don't

#

@rough saffron need to

#

@rough saffron tag me

#

As I already mentioned before

rough saffron
#

Oups sorry

candid pecan
#

And you'd use not_home

rough saffron
#

Ok and can we set a pooling time for automation or is set live by default ?

candid pecan
#

Use a time condition

rough saffron
#

Its look like a fixed time.
If I want when I arrive or I leave the house it executes the automation ?

candid pecan
#

I've no idea what "pooling time" means though

rough saffron
#

OK sorry, i just want to trigger a switchto on on smarthing when im arrive to home and switch off when im leaving with homeassistant. I not sure how to create that in the automation part in home assistant

candid pecan
#

Which part?

#

You've got the switch on already

#
description: Familly away
trigger:
  - platform: state
    entity_id:
      - device_tracker.alexandre_fraser
    to: not_home
condition: []
action:
  - service: switch.turn_off
    data: {}
    target:
      device_id: 9752f5d2d36886b465f19572dba07019
mode: single
#

That'll do it for you leaving

#

If you want to do it so that it only turns it on when the last person leaves, that's different

rough saffron
#

Ok so when another one will arrive or leave the trigger will execute automatically. I dont need to worry for the first time of last trigger run ?

candid pecan
#

You will have to add other entities to the trigger

#

But, that will fire when anybody leaves, even if somebody is still home

#

Hence

#

If you want to do it so that it only turns it on when the last person leaves, that's different

rough saffron
#

Perfect !

candid pecan
#

If you want when the last person leaves that'd be more like

trigger:
  - platform: numeric_state
    entity_id: zone.home
    below: 1
rough saffron
#

Does home assistant are able to read a event into ios or outlook calendar and trigger something about that ?

#

Like holiday days

candid pecan
#

There are calendar integrations

placid oreBOT
candid pecan
#

There's also that

rough saffron
#

Nice, i was searching something to trigger a event into my calendar when kids have no school on specific date

#

Mmmm i did 2 routine one home one not home only for me. I try to run seperate and my switch turn on for home, and when i run the not home one my switch turn off. Is it normal !?

candid pecan
#

Is what normal?

#

That the automations are doing what they're written to do?

#

i just want to trigger a switchto on on smarthing when im arrive to home and switch off when im leaving

#

You said that earlier

#

That's what the automations are doing

rough saffron
#

But they should look if im really at home or not ?

#

With the life sensor ?

candid pecan
#

Well, it's using the person entity, and whatever you have associated with it

rough saffron
#

im using the device tracker instead like this ?

#

alias: Alex not home
description: Alex not home
trigger:

  • platform: state
    entity_id:
    • device_tracker.alexandre_fraser
      to: not_Home
      condition: []
      action:
  • service: switch.turn_off
    data: {}
    target:
    device_id: ac9ed05d08238043a60c75680c8b76b1
    mode: single
candid pecan
#

Well, not_Home isn't valid

rough saffron
#

Oh ! there is a way to know the exact value ?

candid pecan
#

You mean... the value I told you to use before?

rough saffron
#

yes

candid pecan
rough saffron
#

Sorry maybe i dont understand a principle here. Im home right now. if i run manually the not home automation. My switch should not switch off

#

right

candid pecan
#

If you manually run it, it runs the actions

#

So... yes, it turns off the switch

#

you told it to

rough saffron
#

Ooooh ! he doesnt look the condition !

candid pecan
#
  1. There's no condition
  2. It still doesn't apply
rough saffron
#

Thanks ! now i understand !

placid oreBOT
#

To test an automation there's three stages you can follow. Testing the action, the condition and action, and the whole automation:

  1. Use Configuration -> Automations to find the automation and then push Run Actions. If this fails your problem is in the action: section, and details should be found in your log file
  2. Use Developer tools -> Services and call automation.trigger on the automation with skip_condition: false. If the first passes but this fails then the problem is in your condition: block
  3. Use Developer tools -> States to find the trigger entity, click the name, then change the state (at the top) to something that'll trigger the automation before pushing Set State. If this fails then the problem is with your trigger: section, or the automation is turned off (you can check that in Developer tools -> States).

You can also see this section in the docs and with HA 2021.4 onwards debug automations.

rough saffron
#

but i dont know how to do my IF

placid oreBOT
#

@rough saffron To format your text as code, enter three backticks on the first line, press Shift+Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

rough saffron
#
description: ""
trigger:
  - platform: calendar
    event: start
    entity_id: calendar.travail
  - platform: calendar
    event: end
    entity_id: calendar.travail
condition:
  - condition: template
    value_template: "{{ 'Enfants pas ecole' in trigger.calendar_event.summary }}"
action:
  - if:
      - condition: template
        value_template: "{{ trigger.event == 'start' }}"
    then:
      - service: input_boolean.turn_on
        target:
          entity_id: input_boolean.switch_pasecole
        data: {}
    else:
      - service: input_boolean.turn_off
        target:
          entity_id: input_boolean.switch_pasecole
        data: {}
mode: single