Using Numeric Data - Climate and DarkSky

I have a project to automate my HRV (Heat Recovery Ventilator) to control the humidity inside. The actual logic is not an issue. The real challenge is how to specify/format the statements correctly to read actual numeric data from climate.venstar and dark_sky.

States below

Venstar

I have tried in automations and scripts, with a half-hearted attempt with templates. After loading appdameon I thought I should stop and ask for some assistance because it shouldn’t be this painful.

How do I compare the climate temperature to the dark_sky temperature. There are very very few examples using numeric values, and none where the values are buried in the class.

Any suggestions would be greatly appreciated

Mark

assuming they are both true numbers (not numbers represented by strings) then you can compare them like this:

{{ states.weather.dark_sky.attributes.temperature > states.climate.thermostat.attributes.current_temperature }}

or:

{{ state_attr('weather.dark_sky', 'temperature') < state_attr('climate.thermostat', 'current_temperature') }}

If they aren’t already true numbers then you can convert them to numbers like this:

{{ states.weather.dark_sky.attributes.temperature | float > states.climate.thermostat.attributes.current_temperature | float }}

or:

{{ state_attr('weather.dark_sky', 'temperature') | float < state_attr('climate.thermostat', 'current_temperature') | float }}

and you can use “int” in place of “float” if that is what you need.

Thanks I will give that a try tonight.

Is “attributes” actually documented anywhere? The general examples for most automations and scripts are either overly simple or very specific to an application.