I’m just starting with YAML, so I need some help. I have asked AI several times, but nothing was working, I also searched in the Internet - nothing helped.
I’m struggling with the following:
controlling of our heating system
I have a ‘Benthe.temperature.target’ as MQTT-Entity
I have a ‘Benthe.temperature.target.old’ as MQTT-Entity
I want to store the ‘Benthe.temperature.target’ to ‘Benthe.temperature.target.old’, so I can restore that in the morning to the former target. This is already working!
over the night I want to reduce this ‘Benthe.temperature.target’ by for example 3.0 °C
that should happen in an automation every evening at time 22:00
the automation is configured and running
but I cannot subtract the fixed value from the Entity
I have tried a lot, but didn’t succeded
first I tried to do the subtraction in the YAML of the Automation/MQTT-Publish in a lot of different ways
Now I have a template-sensor for the arithmetic - doesn’t word
Can I do that directly in the automation in the YAML of MQTT-Publish?
Or do I need the template sensor or anything else?
Thanks for coming here and asking a question.
Would you be so kind as to adjusting the format of your code so that we can read it properly & check the YAML spacing, etc. Editing your original is the preferred way. It is very hard for us to tell what is what when the text formatter jumbles everything like that.
You can use the </> button like this… How to format your code in forum posts
OR… Here is an example of how to fix formatting from the site FAQ Page. How to help us help you - or How to ask a good question.
Hello Sir_Goodenough,
thx for Your reply. Since three days I’m trying to solve my ‘problem’. I have read in the docs, I searched by Google, I asked Copilot and ChatGPT - I have tried at least 20 different ways and I’m a little bit on the edge. So I hoped to get some serious help.
Can You pls give advice?
best regards and thank You in advance,
Holger
That is ‘sensor.Benthe.temperature.target’ the temperature value MQTT topic and I want to subtract 3.0 fixed value. I always get errors when saving the settings or errors in activities. Always complaining that this are incompatible data types.
How do I have to subtract the fixed-value from the MQTT-topic?
That will be a sensor to get your value out of MQTT.
Is there some reason you are storing stuff in MQTT? Do you use these values outside of this automation? Otherwise just use sensors to store stuff in works without the MQTT complication.
And - yes, there is a reason to store the temperature-values in MQTT. My thermostates in the rooms are about 10 Pi-Picos with display for actual-temperature, target-temperature and humidity and they have buttons for “target +” and “target -” to set an new value. Also they can retrieve data from MQTT. I can also set the target for a room in HA. Also there are 2 more Pi-Picos retrieving several more data from the house, all are stored in MQTT. I have programmed the Picos in MicroPython and they are working just fine.
I will now try to fix my problem with an MQTT-Sensor and will report anyhow.