Thank you!
Oke guys, this is my code till now:
template:
- sensor:
- name: "Keuken sensor battery level"
unit_of_measurement: "%"
device_class: battery
state: "{{ state_attr('binary_sensor.keuken_sensor_motion', 'battery_level') }}"
- name: "Hal sensor battery level"
unit_of_measurement: "%"
device_class: battery
state: "{{ state_attr('binary_sensor.hal_sensor_motion', 'battery_level') }}"
- name: "Toilet sensor battery level"
unit_of_measurement: "%"
device_class: battery
state: "{{ state_attr('binary_sensor.toilet_sensor_motion', 'battery_level') }}"
- name: "Tuin sensor battery level"
unit_of_measurement: "%"
device_class: battery
state: "{{ state_attr('binary_sensor.tuin_sensor_motion', 'battery_level') }}"
- name: "Keuken sensor calibrated temperature"
state: >
{{ (states('sensor.keuken_sensor_temperature')|float +
states('input_number.temp_calibration')|float)|round(2) }}
- name: "Hal sensor calibrated temperature"
state: >
{{ (states('sensor.hal_sensor_temperature')|float +
states('input_number.temp_calibration')|float)|round(2) }}
- name: "Toilet sensor calibrated temperature"
state: >
{{ (states('sensor.toilet_sensor_temperature')|float +
states('input_number.temp_calibration')|float)|round(2) }}
- name: "Tuin sensor calibrated temperature"
state: >
{{ (states('sensor.tuin_sensor_temperature')|float +
states('input_number.temp_calibration')|float)|round(2) }}
@Mariusthvdb I understand from the manual that I should have ‘default config’ in my ‘configuration yaml’ which I have. So, is there anything I need to do now to get it to work?
what do you mean with ‘get it to work’? show them in the Frontend, or make the sensors/input_number exist in HA states. Do they? Can you see them in /developer-tools/state?
Yes I can see them in /develeoper-tools/state.
Now do I have to adjust my Gauge display on my dashboard to the correct sensor?
what do you think… maybe give it a try and see what happens?
hahaha… I did! And this is what happens:
Not calibrated:
Calibrated:
But I have my doubts about the temperature in the garden (tuin)
dont:
the other sensors worry me more… what did you set the input_number to? there’s not much calibration going on in the first 2 sensors…
Minimum value: -2
Maximum value: 2,5
Step size: 0,1
no, what is the state of that input_number? it should be something other than 0 which is what is adds now (unless you didnt change the first 2 gauges in the screenshot)
Hope I understand you correctly
not really… in order to check if the calibrated sensor template works alright, you need to check if the input_number (which you add in the template sensor) actually has a state (a value to add in the template)
for that you need to check in the developer-tools/state and find the input_number
you can also check in the template editor, on developer-tools/template and enter:
{{states('input_number.temp_calibration')}}
{{ (states('sensor.keuken_sensor_temperature')|float +
states('input_number.temp_calibration')|float)|round(2) }}
that way we can see if all is well. please post a screenshot of both pages?
You need to replace the “demo template” code with Marius’s code. Like this:
I get unknown and 0.0 because I don’t have those entities.
And we need to see the state here (with my input_number
as an example):
there we are. you’ve named the input_number temperature_calibration, and use temp_calibration in the template…
rename either and you’re set. probably easiest to change the template to use input_number.temperature_calibration
lesson to learn here: you see the input_number to be unknown. And still the template sensor using that has a value. That is because the |float
makes it a number, albeit with 0 value. so it can be added.
Sorry. My comment was more directed at the changes of the reporting of the motion / light / temperature sensors specifically, not any Hue improvements as a whole.
Yeah, you need to update the temp
to temperature
in your template sensor section and reload template entities (or a full restart).