Help with using input_number in "below" automation

I get “expected float for dictionary value” for this YAML in an automation.

actions:
  - if:
      - condition: trigger
        id:
          - occupied
      - condition: state
        entity_id: light.study_lights
        state: "off"
      - type: is_illuminance
        condition: device
        device_id: e8e4306daa48fe581faae9f60f510520
        entity_id: 2c8ea5fc11b356cff0fcddcfbc0a5f79
        domain: sensor
        below: input_number.minimum_light_level

This is partial YAML. If it’s useful to show in it’s entirety then please let me know but I don’t see why the rest would be relevant.

If I hardcode the below: value, this automation works.

I’ve found a lot of references to this error but despite reading them all, I can’t get my head around why this won’t work.

From what I’ve found, a direct reference to input_number.minimum_light_level on the below: value should be supported.

Apologies if I’ve missed something obvious or got some terminologies mixed up - not been using this for long.

Any help would be greatly appreciated.

Please link to the official documentation that says this.

I can guarantee it is not supported. The numeric_state condition does support this: https://www.home-assistant.io/docs/scripts/conditions/#numeric-state-condition the device condition does not.

Also please see: Why and how to avoid device_ids in automations and scripts

I moved your post to the Configuration category as this is a question about the backend (automations, scripts, integrations, etc…) not the frontend (dashboards, cards, UI etc…).

I’ve not seen the official docs on this so thanks for that. I’ve only seen other threads concluding that it should be possible, but I guess they are old or not correct.

I will take a look at the docs you suggested as I didn’t know that was against the best practices. Strange how when I am constructing the automation it says that using a Device is “a great way to start”. Being from a programming background I did notice the hardcoded ID’s and attempted to change them but ended up stopping them from working. But now I know it’s best not to do that I will go through them now and change them,

Hi, thanks for the help, all sorted!

actions:
  - if:
      - condition: trigger
        id:
          - occupied
      - condition: state
        entity_id: light.study_lights
        state: "off"
      - condition: numeric_state
        entity_id: sensor.motion_study_illuminance_lux
        below: input_number.minimum_light_level

I need help with something else but will start a new thread for that, hopefully in the right place this time!

1 Like