Template sensor wohnzimmer_luft_temperatur has no entity ids configured to track nor were we able
to extract the entities to track from the value template(s). This entity will only be able to be updated
manually.
First off, when you post code you need to format it correctly in the post per the blue box above.
however, that said, it doesn’t make sense what you are trying to do.
you are trying to change the value of a sensor by subtracting a value from the same sensor.
to me I would think that you would quickly get caught up in a infinite loop in that when the sensor changes you subtract 10. then when that changes the sensor it would again subtract 10, etc, etc
Ok, so it should be like:
- platform: template
sensors:
wohnzimmer_luft_temperatur_t:
value_template: ‘{{ sensor.wohnzimmer_luft_temperatur | int - 10 }}’
Or is there any functionality to subtract a integer value from an existing sensor?
Yes, you can use the existing sensor’s value_template (assuming it has one). I can help you if you provide me with the configuration for sensor.wohnzimmer_luft_temperatur.
If it is auto-discovered by Home Assistant, it will be defined in the Entity Registry. You can confirm it is present by looking for it in Home Assistant’s States page.
Here’s an example of my outdoor temperature sensor:
I was going to answer this question:
Or is there any functionality to subtract a integer value from an existing sensor?
by showing you how to make sensor.wohnzimmer_luft_temperatur report a temperature 10 degrees less than what it normally reports (using its value_template). However, I can’t do that (easily) if sensor.wohnzimmer_luft_temperatur is auto-discovered.
It’s possible to modify the configuration of an entity defined by the MQTT Discovery process. Basically, you would publish additional information to the entity’s discovery topic. In this case, you would publish an additional value_template, containing {{value | int - 10 }}, to the sensor’s discovery topic.
However, because you are using ESPHome, you have another option. You can use ESPHome to re-program the sensor so that it always reports a value that is 10 degrees less.
The feature is called Sensor Filters and the one you would use is offset.
Thank you! I have some values that I can adjust with the offset filter. But in Arduino I have the following calculation:
pressure = ((pressure / pow(1.0 - 658/44330.0, 5.255)) / 100);
Ugh, yes. Multiple problems in the original template; not only self-referential but also an invalid state request! I can’t believe I missed that second error. It jumps off the page now! Good catch!