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

Cant use input_number on sun.sun elevation trigger (but conditions work)

$
0
0

Hi,

i’m currently in the process to optimize my automations to a point where i can adjust several values using the input_number integration. Therefore i created a bunch of entries in the input_number.yaml, included it in configuration.yaml.

When i try to use the “input_number.my_custom_entity” within a condition statement, every thing seems to be fine, i can also use them in the actions section. Now, if i want to make use of it in the triggers section, HA complains about

Message malformed: expected float for dictionary value @ data['below']

I`ve also tried to use

"{{ states('input_number.my_custom_entity') | float }}"

Checking the state of “input_number.my_custom_entity” via developer tools tells me, that the value set is float (4.0) when testing.

I dont really understand the different behavior when using the input_number.whatever entities in either of the sections in an automation.

Example Automation that works:

- id: '1600763867713'
  alias: test input
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.pir_room_1_pir
    to: 'on'
  condition:
  - condition: numeric_state
    entity_id: sun.sun
    attribute: elevation
    above: input_number.sun_elevation_end_daylight
  - condition: numeric_state
    entity_id: sun.sun
    attribute: elevation
    below: input_number.sun_elevation_start_daylight
  action:
  - service: light.turn_on
    data:
      brightness: '{{ states(''input_number.brightness_daylight'') | int }}'
      entity_id: light.wled
      kelvin: 3200
    entity_id: light.wled
  mode: single

Example Automation that DOES NOT work:

- id: '1600763867713'
  alias: test input
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.pir_room_1_pir
    to: 'on'
- plattform: numeric_state
    entity_id: sun.sun
    attribute: elevation
    above: input_number.sun_elevation_end_daylight # using: '{{ states(''input_number.sun_elevation_end_daylight') | int }}' or '{{ states(''input_number.sun_elevation_end_daylight') | float }}' doesnt work either 
  condition:
  - condition: numeric_state
    entity_id: sun.sun
    attribute: elevation
    above: input_number.sun_elevation_end_daylight
  - condition: numeric_state
    entity_id: sun.sun
    attribute: elevation
    below: input_number.sun_elevation_start_daylight
  action:
  - service: light.turn_on
    data:
      brightness: '{{ states(''input_number.brightness_daylight'') | int }}'
      entity_id: light.wled
      kelvin: 3200
    entity_id: light.wled
  mode: single

Is there something i missed here or where i was mislead by something? It seems to be impossible to make use of input_numbers within the trigger section?
It`s also strange that using this notation will disable/remove automations from HA with not really good information on what to look at. Error Messages just refer to the line in configuration.yaml where im including the automations.yaml…

Thanks in advance for any hints on how to solve that :slight_smile:

~Blade~

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 107680

Trending Articles



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