I found the correct value in the script. I also want to be able to display the value in the dashboard. To do that I wanted to write the value in the sensor.result. Only I don’t know how to store the value in the sensor.result.
But maybe I should approach that in a different way? I’m new to yaml so I may be doing it all wrong this way.
You have not shown a script. You have only shown a template sensor. From what you are saying you have already accomplished what you want to do. Now just add the sensor ( sensor.gas_consumption ) to your dashboard in an Entities card.
I had already installed the sensor.gas consumption on the dashboard. It gives the value 3626. I just want to show the result of the calculation (-39) on the dashboard.
Let me know if I am wrong but if in the dashboard you have 3626, you have than “sensor.gas_consumed”… In the dashboard, you should have “sensor.gas_consumption”.
Dear people,
Thank you for your help. It took me two days to get this done. Tried all options to no avail. It turns out that one of the sensors turned out to be a boolean instead of a sensor. Stupid mistake, luckily it works now. Thank you .