Implement new esphome attribute support for Home Assistant sensors
With Home Assistant 2021.6 and the next major esphome release (expected in june) esphome will finally support attribute for home assistant sensors :tada: https://github.com/esphome/esphome/pull/1770
@mikosoft83 any update?
@Adam-North Unfortunately since 0.17 or so something happened in ESPH I2C implementation and none of my Screen devices work for more than couple of hours, then they get stuck. It's almost impossible to do any development at this stage.
I opened an issue for this way back in May but there seems to be no movement. So you can vote it up: https://github.com/esphome/issues/issues/2071
Wow okay I haven't run into that issue yet running the latest on my pithy screen plus. Are you on the latest esphome release?
Yes, I have auto-update of ESPH in HA, I tested with every new release, it's been dragging since 0.17 and hasn't changed. It seems to be kinda random, some people will experience it, some won't. I think John from ioios himself had this issue with one of his devices even running his own software so it seems it's not specific to mine. Probably the only thing now is to spread the knowledge of this issue and vote it up so it gets the attention but the bugreport is so huge for ESPH and the issue quite specific I'm not really holding my hopes very high.
hi @mikosoft83 firstly thank you for this great work!
Now that the i2c issue is resolved ? Would it be possible to update the generator to include the attributes option ? this way we can keep the home assistant side config untouched . Would be very helpful
Thanks and Regards Sharath B K
@sharathbk1912 yep, I actually started the work but life gets in the way :) I'm working on it intermittently, will try to get to it done as quickly as I can
@mikosoft83 Please take your time . Was just curious to know if the updates are coming . Thanks again! Also I was just trying to hack manually the attribute part and try however the progress bar , nan etc come up. May its not easy to just hack it at few places. Will wait for the update :)
@sharathbk1912 if you want to hack it manually the only thing you should need to do is to change the sensor definition in the ESPHome YAML file itself. Instead of using entity_id: sensor.template_sensor use entity_id: sensor.real_sensor and the attribute, the rest can stay as is (although the naming will be out of sync).
Also, I suggest to keep the original generated YAML config, I will try to make the generator to import the older style configs (with template sensors) and have it convert to the new one with attributes. I can't yet say I'll succeed but it's a plan at least :D
@mikosoft83 I did that it works for the setting(continuous and continuous with setting ) part . However the display in the menu says Nan. THe one above the label in menu. ALso one more question the progress bar(rectangle filled bar) seems off . Which part controls the progress bar for different entity/menu ? mine only fills a bit even on full scale of say light brightness .