Value cannot be processed as a number - help

Wait … there’s an error here … gimme 5 Okay, good to go …

You will need to set up time and date sensors, see -

Taking @Burningstone 's binary_sensor as a start point : -
[the below assumes binary_sensor.ace_bin_sensr and automation.dumb_trigger]

binary_sensor:
  - platform: template
    sensors:
      ace_bin_sensr:
        friendly_name: "Fab Trigger for Other Stuff"
        value_template: >
          {# the '>' above tells you to expect a multi-line template rather than a single line #}
          {# this like the line above is a comment and doesn't do anything #}
          {# The line below is an evaluation statement and is only valid during this template's life, usually ~ half a millisecond #}
          {% set tme = states('sensor.time') %}
          {# let's get the date as well (value not actually needed but ... ) #}
          {% set dte = states('sensor.date') %}
          {# and when did that last change ? #}
          {% set dtechg = as_timestamp(states.sensor.date.last_updated) %}
          {# the following does a TEXT comparison to see if the time is between the required limits #}
          {% set tgud =  '06:30' <= tme <= '08:30' %}
          {# so is the temperature below the trigger limit ? #}
          {% set temp_low = states('sensor.outdoor_temperature') | float < 1 %}
          {# now we only care about if the automation has been fired since midgnight so when was it last fired ? #}
          {% set lst_frd = as_timestamp(states.automation.dumb_trigger.attributes.last_triggered) %}
          {# and if never yet fired set it to epoch start #}
          {% set frd = 0 if as_timestamp(states.automation.dumb_trigger.attributes.last_triggered) | string == 'None' else lst_frd %}
          {# and is that before midnight just past ? #}
          {% set firstofday = frd < dtechg %}
          {# the line below is a print statement and is the output of ALL the above #}
          {{ firstofday and tgud and temp_low }}
        delay_on: "00:30:00"

Provided this is called binary_sensor.ace_bin_sensr and the messaging automation is called automation.dumb_trigger this will only fire if it’s the first of the day and the temp is below -1 degree and it’s been that way for 30 mins
The automation triggers on this sensor going to ‘on’ from ‘off’ - it then just needs to carry your payload.

once working change the names (in all instances) to suit your requirements

Couldn’t test this but lets see what your config check etc. says

Condensed version : -

binary_sensor:
  - platform: template
    sensors:
      ace_bin_sensr:
        friendly_name: "Fab Trigger for Other Stuff"
        value_template: >
          {% set tme = states('sensor.time') %}
          {% set dtechg = as_timestamp(states.sensor.date.last_updated) %}
          {% set tgud =  '06:30' <= tme <= '08:30' %}
          {% set temp_low = states('sensor.outdoor_temperature') | float < 1 %}
          {% set lst_frd = as_timestamp(states.automation.dumb_trigger.attributes.last_triggered) %}
          {% set frd = 0 if as_timestamp(states.automation.dumb_trigger.attributes.last_triggered) | string == 'None' else lst_frd %}
          {% set firstofday = frd < dtechg %}
          {{ firstofday and tgud and temp_low }}
        delay_on: "00:30:00"

Given this set up you will NEVER get a notification before 07:00 as you request this to be valid from 06:30 and to wait 30 minutes
:man_shrugging:

1 Like

This could be condensed even further (around the ‘test never fired’) but this way you see that ‘other’ things need to be accounted for, so think hard about what ‘could’ go wrong

Edit: I’d also like to point out that if it has been -20°C all night long and at 06:59 a miracle happens, the sun comes out or a bird has decided to cuddle up close to your sensor
Your Car will still be encased in ice and you won’t get a notification.
:man_shrugging:

Edit2: It has to be a binary sensor trigger as most people (when using numeric state) fail to realise that if it’s already below the ‘below’ temperature (or above the ‘above’ depending on the requirement) it won’t trigger. This is because it has to cross the threshold, then the ‘for’ kicks in. Read the docs.

EDIT : 2020 - 01 - 05
Not Allowed 3 consective replies

Dave,
It’s best not to ask for help via PM and then the ‘problem’ is lost as is both the ‘solution’ and the learning benefit to others with the same issues.

The first thing I need to ask is where you placed : -

  • The binary_sensor ?
  • The automation ?

I see you have been playing with the template editor, that is good.
A couple of points before we start : -
states.sensor.time - will not produce anything useful (template wise) I get - <template TemplateState(<state sensor.time=13:40; friendly_name=Time, icon=mdi:clock @ 2021-01-05T13:40:00.002888+00:00>)>
It needs to be states('sensor.time') — [or the older states.sensor.time.state but try not to use this form, there are VERY few instances when it is better]
{{ ‘06:30’ <= states.sensor.time >= ‘08:30’ }} - even if it did, look at the question you are asking here - is ‘time’ Greater or equal than 06:30 AND is it Greater or equal to 08:30 ??? that’s daft !
Don’t make up syntax, it won’t work, find a good example of what you want to do, copy that, then modify it to your use case.
Cut and paste the following into the editor and take a screenshot of what you get returned : -

{% set tme = states('sensor.time') %}
tme:- {{ tme -}}
{% set dte = states('sensor.date') %}
dte:- {{ dte -}}
{% set dtechg = as_timestamp(states.sensor.date.last_updated) %}
tsdtechg:- {{ dtechg -}}
{% set tgud =  '06:30' <= tme <= '08:30' %}
tgud:- {{ tgud -}}
{% set temp_low = states('sensor.outdoor_temperature') | float < 1 %}
temp value:- {{ states('sensor.outdoor_temperature') }}
temp_low:- {{ temp_low -}}
{% set lst_frd = as_timestamp(states.automation.dumb_trigger.attributes.last_triggered) %}
last fired:- {{ lst_frd -}}
{% set frd = 0 if as_timestamp(states.automation.dumb_trigger.attributes.last_triggered) | string == 'None' else lst_frd %}
frd:- {{ frd -}}
{% set firstofday = frd < dtechg %}
firstofday:- {{ firstofday }}
template output:- {{ firstofday and tgud and temp_low }}

This is the same code, but modified to run on my system (I don’t have the same entities as you do) : -

{% set tme = states('sensor.time') %}
tme:- {{ tme -}}
{% set dte = states('sensor.date') %}
dte:- {{ dte -}}
{% set dtechg = as_timestamp(states.sensor.date.last_updated) %}
tsdtechg:- {{ dtechg -}}
{% set tgud =  '06:30' <= tme <= '08:30' %}
tgud:- {{ tgud -}}
{% set temp_low = states('sensor.s_heat_thermostat_temp') | float < 1 %}
temp value:- {{ states('sensor.s_heat_thermostat_temp') }}
temp_low:- {{ temp_low -}}
{% set lst_frd = as_timestamp(states.automation.au_heat_temperature_set_value.attributes.last_triggered) %}
last fired:- {{ lst_frd -}}
{% set frd = 0 if as_timestamp(states.automation.au_heat_temperature_set_value.attributes.last_triggered) | string == 'None' else lst_frd %}
frd:- {{ frd -}}
{% set firstofday = frd < dtechg %}
firstofday:- {{ firstofday }}
template output:- {{ firstofday and tgud and temp_low }}

This produces : -
image
Which all seems to be right