The weather station sends data from the wind direction sensor in base64 format. How can I automatically convert the data from this sensor from base64 to ansii and view the result in degrees?
not sure what you get from the sensor, but adding the following lines into devtools>template-editor does is encode and decode
{% set t = "Hello!" | base64_encode %}{{ t }}
{% set n = "SGVsbG8h" | base64_decode %} {{ n }}
data from the sensor is constantly changing, i.e. n = a variable value. what template should I use for a variable?
Try to read through
It’s all explained in there. And if you get stuck … post your code so anyone could assist. Simply posting a working solution won’t improve your skills with HA.
btw: you could surely try something such as
{{ states(‘sensor.yoursensor’) |base64_decode }}
if you fancy to have something dynamc since the “yoursensor” changes permanently.
but you must rename “yoursensor” to the name your sensor got.
That’s the core thing, the surrounding lines of code and where to place such a yaml template sensor could be found in the linked document.