I’d like to be able to set a variable / number on the web_server webpage, have it persist during reboots, and use that number in some calculations.
I’ve tried to do my homework, and the closest I could find was probably this guide: ESPHome variables from Home Assistant - Schinckel.net
Difference being, I’d like it to be set in either the web page, or alternatively over MQTT.
Use Case:
I have a pellet furnace where I found a UART port that dumps the current parameters once a second (including output %).
I’d like to multiply this output number with the furnaces current max output setting (set by the user on the furnace, but not dumped over UART), and the pellets calorific value to get a kWh reading that I can use in the Gas Consumption tab of of the Energy dashboard.
I’ve tried different approaches, none work and I feel like I’m missing a simple solution.
Latest approach was to simplify and do this, but this does not give me an option to setting it in the web interface:
ESP8266 requires an explicit restore_from_flash config.
ESP32 I assume just does it, the only issue you could run into when testing is the flash_write_interval, flash is only written every 60 seconds by default I think, to save flash wear.
No worries with the reading guys. I was a little surprised when I came here to se how much ESPHome is married to Home Assistant.
I just happen to have recently migrated some of my things to Home Assistant. But I’d like to be able to go back to OpenHAB some day if I feel like it.
HA is not on the same VLAN as my ESP devices, so I’d like to keep the the communication going through MQTT if possible.
Its running on a ESP8266 for what its worth.
And thanks for the code snipped @zoogara . I’ll try it out in a day or two when I have time!
Its funny. I write C++ in my day job, but much of the YAML syntax with ESPHome just seem…
I can read and understand it, but I can’t read the documentaion without examples and figure out that in on_boot I can put a then: and a nested number.set ect.