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

Automation with sensor threshold (sun azimuth) doesn't work

$
0
0

@Nick4 wrote:

Hi all

I’m trying to use the sun azimuth to close/open curtains.
In configuration.yaml I have created these sensors:

binary_sensor:
  - platform: template
    sensors:
      sun_azimuth:
        friendly_name: "Sun Azimuth"
        unit_of_measurement: 'degrees'
        value_template: "{{ state_attr('sun.sun', 'azimuth') }}"

binary_sensor:
  - platform: threshold
    upper: 311
    lower: 308
    entity_id: sensor.sun_azimuth
    name: "sun azimuth front"

This is the automation (for now it’s just a test with a mediaplayer):

- id: '1590702116486'
  alias: test sun front
  description: ''
  trigger:
  - entity_id: binary_sensor.sun_azimuth_front
    from: 'off'
    platform: state
    to: 'on'
  action:
  - data: {}
    entity_id: media_player.1
    service: media_player.media_pause

I have tested the sun_azimuth template which returns the right value.
The ‘binary_sensor.sun_azimuth_front’ state remains off after the sun has passed the lower value.
Am I doing something wrong or what am I missing?

Thanks A LOT in advance!
Nick

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 102648

Trending Articles