The latest release of Home Assistant (2024.10.0) includes an update to the core Emoncms component thanks to @alexandrecuer for his hard work in navigating the minefield of developing for Home Assistant.
Of note, the ‘Scan interval’ option is removed as this is deprecated by HomeAssistant. If you are relying on this to feed emoncms, you will need another mechanism such as NodeRED to feed data at regular intervals.
[edit]
To note the emoncms integration (data from emoncms to HA) has been updated. The emoncms_history integration (data from HA to emoncms) has not been updated and this continues to rely on YAML configuration.
Not sure what you mean by reporting interval… The scan_interval interval is indeed deprecated but you can use an automation to monitor at a period different than 60 seconds…
I just fixed my further downstream template sensors and utility meters to use the new names. I don’t have a lot depending on it so it wasn’t an issue. The guy on GitHub probably has more depending on it and renamed sensors can be a pain. Could you in principle assign a unique id you generate but reuse the “old” name of the sensor as was configured in the yaml?
The state class issue is a different beast, it should be “measurement” (for things like power, temperature etc) or “total” for energy measurements that are accumulated. When those are not set, the data will not be recorded into longterm stats, which is a pity as many would maybe like to use the enoncms data inside their energy dashboards. I guess you could allow setting a state class during config by the user.
Ok so if he changes the names manually, he should reconnect with his old statistics ?
I did not change anything as far as state_class is concerned…all is measurement except energy which is total increasing…
Maybe it is because if there is no unit fixed in emoncms, nothing is fixed in the new code for device_class
Before for feeds that did not have a unit in emoncms, the default device_class was fit to energy…
I have gone through issues like this repeatedly in the past with smart energy meters, changed integrations and so on. My solution is to have template sensors that simply mirror the current meter, e.g. I have a “sensor.energy_persistent” that just gets assigned the state of my current energy smart meter. If I get a new meter that ends up in a different entity, I just need to change the template sensor expression and get to keep my statistics. I use the same approach for heat generated for heating and DHW. It doesn’t help anyone facing the issue now but Inthink it is a good practice to insure against any future issues.
Yes i confirm that @Andre_K is perfectly right on both topics
use template sensors through the homeassistant template integration…the previous version of the emoncms with the yaml template parameter was really a bad idea…template sensors are the way to go for the ha dev team
you will not have to rename more than one time cause the entities created by the emoncms integration now have a unique identifier
I’d just like to emphasise the level of effort @alexandrecuer has put into this. If you are interested this is the GitHub link Migrate emoncms to config flow by alexandrecuer · Pull Request #121336 · home-assistant/core · GitHub and the number of discussions including one that involved the HA Dev team eventually allowing something they normally don’t (they wanted all available sensors/Feeds imported automatically - they saw sense). There were some other associated changes as well.