Value cannot be processed as a number - help

The problem is that there’s no real trigger for your automation. You could trigger every 10 minutes, but then you’d get a notification every 10 minutes if the condition is still true. You could trigger at 6:30, then you’d lose the time between 6:30 and 8:00. You could trigger on the temperature, but then it would need to happen between 6:30-8:00 and not before.

Yes, I know, the other automation with the trigger on the temperature looks as following, just want to be sure that it works every day, even if the temp was not above 1°C since last day / trigger. Any idea if this works like this?
Thank you - Dave

trigger:
  - platform: numeric_state
    entity_id: sensor.outdoor_temperature
    below: '1'
    for: '0:30:00'
    above: '-30'
condition:
  - condition: time
    after: '06:30:00'
    before: '08:30:00'
action:
  - service: notify.pushbullet_ha
    data:
      message: Test1 - Temperatur Aussen <1° - MORGENS
mode: single

It’s complaining about the “for” in the condition, which isn’t valid for a condition but should work fine in the trigger.

This is a somewhat interesting because I assume it will not retrigger if the temperature never leaves the range specified.

From the numeric_state trigger:

fires if the value is changing from above to below or from below to above the given threshold

Given that, it may be better to describe what you’re actually trying to accomplish with this. Why does the value need to be in that range for 30 minutes? Does your temperature sensor even update more often than that? Would it suffice to just notify once if the temperature is ever within that range within the given time period? Do you want to avoid duplicate notifications (which you could potentially get with it written as-is)?

1 Like

The reason is, that want to see the temperature for a certain time below the trigger level.
Anyhow, that’s not that important.
So would it be easier whiteout this request? And if so, what would you suggest for trigger and conditions? Thanks, Dave

What are you going to do with this information? Is it used to turn on something? Maybe there’s a better way to trigger your automation.

Use a binary template sensor, put all your conditions in there (template out to helpers if need be) then just trigger on that.
The OP was pretty unclear on the actual URS / FDS so that’s why I responded to you :rofl:

maybe a good approach with the binary sensor, I am still learning.
How to implement the binary sensor, I just tried but did it not work properly.

binary_sensor:
  - platform: template
    sensors:
      TrigTemp:
        friendly_name: "TrigTemp"
        value_template: >-
          {% if states('sensor.outdoor_temperature''<-1') %}
          {% endif %}

yes, I just want to start something and give a notification with this information about the temperature. Do you see a better way for this? Thanks Dave

coming back to my original issue ‘value can not processed as a number’ it looks to me still not properly solved. Could anybody help and pass me a short code. I just want to have following:

  • when temperature from entity_id: sensor.outdoor_temperature is below a certain value and time is between start - end --> do action
  • this should be triggered only once a day (during that certain time)

Thank you - Dave

Thank you - Dave

Your trigger is the temperature below value and the condition is time of day. First write the automation with only the trigger, that way you can address/find the cause of your cannot be processed as a number error. Once you have that worked out then add the condition.

yes, but I am still struggeling with the trigger and correct format,

following gives me correct values (check within template)

{{ float(states.sensor.outdoor_temperature.state) }}

but below does not gives me any action

platform: numeric_state
    entity_id: sensor.outdoor_temperature
    below: '1'
    for: '0:30:00'
    above: '-30'

Yes but does the automation show that it triggers in the logs?

Go to Developer Tools -> States and set the value of sensor.outdoor_temperature to a value below 1 and above -30 and wait 30 minutes. (Pull the battery from the sensor so that it doesn’t update)

Just how cold do you expect it to get ?
Why does say - 28 need a trigger and - 32 not ?

Clarify why you need the notification between certain times ?

Why do you have to wait 30 minutes ?

I’m guessing you have just a standard configuration ie automations go in automation.yaml ?

What is the middle line here supposed to be doing ? What have ‘sensors’ to do with the price of fish ?

Give me a couple of hours and I’ll get to a work station (I’m on my phone at the moment)

I dunno what has happened but the documentation (and @Burningstone 's efforts below) agree that “sensors:” is both required and in the position you have shown it (inded even my own config has this)
I can only attribute this to Altzheimers or simple stupidity (I’m very dissapointed in Burning that he didn’t slap me down straight away and save me some embarassment :rofl: )
I have to go edit another thread (basically same issue) then I’ll come back and deal with the ‘day’ bit

1 Like

correct, I started with a standard automation and struggled by the “value cannot processed as a number” and then moved over to made my own automation.

I only need to get an action when temperature is below certain level (e.g. 1°), no need for the “above -30” (came from the standard automation).

About the 30 minutes, I want to see the temperature for a certain time below that level, as a kind of histeresis.

I am open to any suggestion to solve this, thanks. Dave

The only solution I can think of right now is creating a binary_sensor that is on when the temp is below 1 for 30 min:

binary_sensor:
  - platform: template
    sensors:
      temp_below_1_30min:
        friendly_name: "Temperature below 1 for 30 minutes"
        value_template: >-
          {{ states('sensor.outdoor_temperature') | float < 1 }}
        delay_on:
           minutes: 30

Then create an input_boolean for only sending the notification once:

input_boolean:
  temp_notify_sent_today:
    name: Temp notification sent today

Then trigger your automation every 5 minutes, if the binary sensor is on and the input boolean is off -> send notification and turn on input boolean:

trigger:
  - platform: time_pattern
    minutes: 5
condition:
  - condition: time
    after: '06:30:00'
    before: '08:30:00'
  - condition: state
    entity_id: input_boolean.temp_notify_sent_today
    state: 'off'
  - condition: state
    entity_id: binary_sensor.temp_below_1_30min
    state: 'on'
action:
  - service: notify.pushbullet_ha
    data:
      message: Test1 - Temperatur Aussen <1° - MORGENS
  - service: input_boolean.turn_on
    entity_id: input_boolean.temp_notify_sent_today
mode: single

Then a second automation to reset the input boolean at midnight:

trigger:
  - platform: time
    at: '00:00:00'
action:
- service: input_boolean.turn_ff
    entity_id: input_boolean.temp_notify_sent_today

Thank you, tried it but got another failure when saving the automation.
Any ideas? Thanks

failure:
Message malformed: extra keys not allowed @ data[‘binary_sensor’]

automation:

binary_sensor:
  - platform: template
    sensors:
      temp_below_1_30min:
        friendly_name: "Temperature below 1 for 30 minutes"
        value_template: >-
          {{ states('sensor.outdoor_temperature') | float < 1 }}
        delay_on:
          minutes: 30
input_boolean:
  temp_notify_sent_today:
    name: Temp notification sent today
trigger:

The binary_sensor and the input_boolean doesn’t go into automations.yaml. this goes into condiguration.yaml.

Just further to @Burningstone 's note.

It is an easy mistake to make, if you wish to avoid these you ‘may’ wish to look at packages which will pretty much accept anything you drop in there, as long as the input_boolean’s and script’s etc. are kept together

Anyway :

  1. ONLY Automations are stored in automations.yaml
  2. ONLY Scripts are stored in scripts.yaml
  3. ditto groups.yaml
  4. ditto scenes.yaml

If you want helpers through the front end (GUI) (input booleans, input texts, input numbers etc. they are stored within HA in the .storage folder (the dot before storage is unix for hidden)

Everything else goes into configuration.yaml (unless you run packages) OR you could ‘include them’ as in “write a line in configuration.yaml” (from the documentation https://www.home-assistant.io/docs/configuration/splitting_configuration/) : -

homeassistant:
  # Name of the location where Home Assistant is running
  name: My Home Assistant Instance
  # Location required to calculate the time the sun rises and sets
  latitude: 37
  longitude: -121
  # 'metric' for Metric, 'imperial' for Imperial
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/Los_Angeles
  customize: !include customize.yaml

The last line is the important bit here it is a child of homeassistant: and is thus indented 2 spaces from homeassistant (the lines between don’t matter as they are all of the same rank (1st children)
Basically you write customisations below customise: but here it’s telling you to read the contents of customize.yaml ‘as if it were below customize’ so you can write all your customizations in there.
The same is true for other stuff
Customize is a child of Home assistant but from lower down the same document you will see : -

automation: !include automation.yaml
zone: !include zone.yaml
sensor: !include sensor.yaml
switch: !include switch.yaml
device_tracker: !include device_tracker.yaml

These are not children, so NOT indented, the same would be true of : -

binary_sensor: !include binary_sensor.yaml
input_boolean: !include input_boolean.yaml

NOTE : the last file above (input_boolean.yaml) is a yaml configuration of input_boolean but I’ve already said that they are stored in HA under .storage and that’s true but you can also create them manually the choice is up to you, some people like manual (transferable) and some like the GUI (which requires a couple of screenshots per entity)

1 Like