Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95493

What's a better solution?

$
0
0

@SylvainGa wrote:

So what’s better, resource wise, between these two automations:

It’s use to check every hours between 1 and 5 am if the temperature was raised and then lower it back.

This code runs at 1, 2, 3, 4 and 5 am.

- id: '1584584156367'
  alias: Présence - Michèle la nuit
  description: ''
  trigger:
  - hours: '1'
    platform: time_pattern
  - hours: '2'
    platform: time_pattern
  - hours: '3'
    platform: time_pattern
  - hours: '4'
    platform: time_pattern
  - hours: '5'
    platform: time_pattern
  condition:
  - condition: state
    entity_id: person.michele
    state: Home
  - condition: state
    entity_id: light.lumieremicheleplafonnier
    state: 'Off'
  - condition: state
    entity_id: light.chambre_de_michele
    state: 'Off'
  action:
  - data:
      temperature: 17
    entity_id: climate.neviweb130_climate_michele
    service: climate.set_temperature

This code runs every hour and condition limits it to kick in between 1 and 5 am.

- id: '1584584156367'
  alias: Présence - Michèle la nuit
  description: ''
  trigger:
  - hours: '*'
    platform: time_pattern
  condition:
  - condition: state
    entity_id: person.michele
    state: Home
  - condition: state
    entity_id: light.lumieremicheleplafonnier
    state: 'Off'
  - condition: state
    entity_id: light.chambre_de_michele
    state: 'Off'
 -  condition: time
    after: '00:59:00'
    before: '05:59:00'
  action:
  - data:
      temperature: 17
    entity_id: climate.neviweb130_climate_michele
    service: climate.set_temperature

Thanks.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95493

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>