Simple Version

automation:
 - alias: 'Muito frio'
 trigger:
 platform: numeric_state
 entity_id: sensor.temperature_158d00010bedca
 below: 16.5
 condition:
 condition: and
 conditions:
 - condition: state
 entity_id: switch.Bomba
 state: 'off'
 - condition: or
 conditions:
 - condition: state
 entity_id: 'device_tracker.twbghzzp_maianexus6p'
 state: 'home'
 - condition: state
 entity_id: 'device_tracker.twbghzzp_patuxaa5'
 state: 'home'
 action:
 - service: homeassistant.turn_on
 entity_id: group.AC
 - service: notify.famaia
 data:
 message: 'Temperatura abaixo de 16.5º, ligando ar condicionado.'


 - alias: 'Fim aquecimento'
 trigger:
 platform: numeric_state
 entity_id: sensor.temperature_158d00010bedca
 above: 20
# for:
# minutes: 5
 condition:
 condition: and
 conditions:
 - condition: state
 entity_id: switch.Bomba
 state: 'on'
 - condition: or
 conditions:
 - condition: state
 entity_id: 'device_tracker.twbghzzp_maianexus6p'
 state: 'home'
 - condition: state
 entity_id: 'device_tracker.twbghzzp_patuxaa5'
 state: 'home'
 action:
 - service: homeassistant.turn_off
 entity_id: group.AC
 - service: notify.famaia
 data:
 message: 'Temperatura acima de 20º, desligando ar condicionado.'

Version with Input Sliders

automation:
 - alias: 'AC On 23:30'
 trigger:
 platform: time
 after: '23:30:00'
 action:
 - service: homeassistant.turn_on
 entity_id: group.AC
 - service: notify.famaia
 data:
 message: 'AC On 23:30'
 
 - alias: 'AC Off 23:59'
 trigger:
 platform: time
 after: '23:59:00'
 action:
 - service: homeassistant.turn_off
 entity_id: group.AC
 - service: notify.famaia
 data:
 message: 'AC Off 23:59'


automation:
  - alias: 'Muito frio'
    hide_entity: true
    trigger:
      platform: template
      value_template: "{% if (states.sensor.temperature_158d00010bedca.state < states.input_slider.slider_temp_min.state) %}true{% endif %}"     condition:       condition: and       conditions:         - condition: state           entity_id: switch.Bomba           state: 'off'         - condition: or           conditions:             - condition: state               entity_id: 'device_tracker.twbghzzp_maianexus6p'               state: 'home'             - condition: state               entity_id: 'device_tracker.twbghzzp_patuxaa5'               state: 'home'     action:       - service: homeassistant.turn_on         entity_id: group.AC       - service: notify.famaia         data:           message: 'Temperatura abaixo de "{{ states.input_slider.slider_temp_min.state | float }}", ligando ar condicionado.'              - alias: 'Aquecimento concluído'     hide_entity: true     trigger:       platform: template       value_template: "{% if (states.sensor.temperature_158d00010bedca.state > states.input_slider.slider_temp_max.state) %}true{% endif %}"
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: switch.Bomba
          state: 'off'
        - condition: or
          conditions:
            - condition: state
              entity_id: 'device_tracker.twbghzzp_maianexus6p'
              state: 'home'
            - condition: state
              entity_id: 'device_tracker.twbghzzp_patuxaa5'
              state: 'home'
    action:
      - service: homeassistant.turn_on
        entity_id: group.AC
      - service: notify.famaia
        data:
          message: 'Temperatura acima de "{{ states.input_slider.slider_temp_max.state | float }}", desligando ar condicionado.'

hass --script check_config
Advertisements