anand-p-r / hslhrt-hass-custom

HASSIO Custom Integration for HSL HRT
GNU General Public License v3.0
17 stars 8 forks source link

Sensor attributes missing #21

Open felixrohrbach opened 2 years ago

felixrohrbach commented 2 years ago

Using HA Core 2022.4.6 Using Plugin Version 0.3.5

Sensor seems to update (in developer tools last changed/last updated changes), but sensor no longer carries the additional attributes like Destination, Arrival time, ...

anand-p-r commented 2 years ago

@felixrohrbach Have been very busy off late. Sorry! Will get to this issue soon. Hang in there!

sla004 commented 2 years ago

I'm also waiting this...

MikkoIlari commented 1 year ago

Is this still working? I cannot get values for cards or values are all the time same. That differs what card I am trying to use.

MikkoIlari commented 1 year ago

This was solution for my problem. Thanks to jroine.

Hi,

it appears that this module is currently broken because device_state_attributes has been replaced by extra_state_attributes.

Workaround: replace line 105 of sensor.py from def device_state_attributes(self): to def extra_state_attributes(self):

felixrohrbach commented 1 year ago

@MikkoIlari : for me this problem still exists. I tried to make the change you mentioned, but now the integration does not create the sensors. Maybe to retrace what I did:

Did you make any further changes to the files besides the one that you mentioned?

MikkoIlari commented 1 year ago

@MikkoIlari : for me this problem still exists. I tried to make the change you mentioned, but now the integration does not create the sensors. Maybe to retrace what I did:

  • removed the integration for my stop
  • downloaded latest files from github
  • made changes to the file
  • copied all into the custom_components folder like I had before
  • restarted homeassistant
  • added integration by entering my stop code
  • integration is added, but no device/entity is set up for it

Did you make any further changes to the files besides the one that you mentioned?

Hi,

I only change that def device_state_attributes(self): to def extra_state_attributes(self): and it started to work.

kavaleff commented 1 year ago

Same problem here, won't work even with the suggested change on code. Deleted integration and reinstalled, no change. Can only see Route number in the entity, no other attributes.

Any help from author is highly appreciated.

MikkoIlari commented 1 year ago

Hi,

I have this version:

Home Assistant Core Installed version 2022.10.4

I have used examples from here: https://github.com/anand-p-r/hslhrt-hass-custom/blob/main/README.md

I do not have any tips, but I can check my configuration if you have any questions.

Screenshot 2022-10-24 at 16 11 10
viljate commented 1 year ago

For me suggested fix got this working again. Thanks!

Leissson commented 11 months ago

This was solution for my problem. Thanks to jroine.

Hi,

it appears that this module is currently broken because device_state_attributes has been replaced by extra_state_attributes.

Workaround: replace line 105 of sensor.py from def device_state_attributes(self): to def extra_state_attributes(self):

This worked for me, thx @MikkoIlari !