Where do you put this code?
I’m new to home assistant and cant understand wich file to put all the code into?
/Tomas
Where do you put this code?
I’m new to home assistant and cant understand wich file to put all the code into?
/Tomas
If you are new to HA you probably haven’t edited any yaml files as a lot can be done these days from the Configuration tab, but this needs to go in your configuration.yaml file.
Install the File Editor add-on from the Supervisor add-on store to get started.
I did a copy and paste of this and just replaced my sensor names and elevation but it returns a value of 0.0?
Hmm. Then one of your sensor values is probably wrong.
Pasting this into your template editor (substituting your sensors and elevation):
{{ states('sensor.man_cave_temperature') }}
{{ states('sensor.man_cave_air_pressure') }}
{{ (states('sensor.man_cave_air_pressure')|float * (1 - (0.0065 * 175) / (states('sensor.man_cave_temperature')|float + (0.0065 * 175) + 273.15)) ** -5.257) | round(1) }}
Should give a result like:
Result type: string
18.2
1000.2
1020.9
This template listens for the following state changed events:
Entity: sensor.man_cave_air_pressure
Entity: sensor.man_cave_temperature
Also paste your template sensor definition, that you have edited, rather than the one I use - so we can see if any weird typos.