zxdavb / ramses_cc

HA integration for CH/DHW and HVAC systems that use the RAMSES II RF protocol
GNU General Public License v3.0
80 stars 17 forks source link

0.31.x: Missing entities #130

Closed zxdavb closed 10 months ago

zxdavb commented 10 months ago

There is a large cohort of entities that are not being exposed in the Lovelace UI, despite being instantiated.

For example, for the TRV with ID 04:189078, we get:

2024-01-10 00:14:22.043 INFO (MainThread) [custom_components.ramses_cc.binary_sensor] Found 04:189078 (TRV): window_open
2024-01-10 00:14:22.043 INFO (MainThread) [custom_components.ramses_cc.binary_sensor] Found 04:189078 (TRV): battery_low
2024-01-10 00:14:22.047 INFO (MainThread) [custom_components.ramses_cc.sensor] Found 04:189078 (TRV): temperature
2024-01-10 00:14:22.048 INFO (MainThread) [custom_components.ramses_cc.sensor] Found 04:189078 (TRV): heat_demand

But these entities all exist in the entity register, albeit some with/with unavailable.

They just don't appear in HA's default dashboard. The exception is temperature, which is appearing OK (despite available / unavailable status).

I can add them in a bespoke dashboard, and also see their state in Settings > Devices & Services > Entities.

I should note that None of my binary sensors are appearing in the UI,

zxdavb commented 10 months ago

I am not sure if this is related to https://github.com/zxdavb/ramses_cc/pull/118?

IIRC, v0.31.1 is the first public release that includes this commit.

zxdavb commented 10 months ago

@trvrnrth See above - do you have any thoughts - I've had a quick look, but cannot see what's the issue - I am using the latest dev branch of HA.

I think these are a separate issue:

binary_sensor.13_237335_active
water_heater.stored_hw
binary_sensor.01_145038_schema
sensor.01_145038_hw_heat_demand

... and I will chase them down tomorrow-ish.

zxdavb commented 10 months ago

These coudl be in either group - dunno:

sensor.10_064873_boiler_output_temp
sensor.10_064873_ch_max_setpoint
sensor.10_064873_ch_water_pressure
binary_sensor.10_064873_dhw_enabled
binary_sensor.10_064873_fault_present
zxdavb commented 10 months ago

See:

trvrnrth commented 10 months ago

Diagnostic sensors (ie. entities with an category of EntityCategory.DIAGNOSTIC) are not included in the default dashboard.

I'll take a look at the other reported issues and see if I can spot anything.

trvrnrth commented 10 months ago

For binary_sensor.13_237335_active your fix looks correct. I had misread the intention of the old RamsesActuator entity class and must have forgotten to bring it up during review.

The change made in https://github.com/zxdavb/ramses_cc/commit/bba4b06b060c02aa3ee62615a2f73a53e5bea7a0 could probably be moved to the base RamsesBinarySensor as there's no harm doing the cast for all entities but otherwise seems correct.

trvrnrth commented 10 months ago

binary_sensor.01_145038_schema is renamed binary_sensor.01_145038_status. I thought we'd had a conversation about that on a previous PR but I can't find it at the moment.

trvrnrth commented 10 months ago
sensor.10_064873_boiler_output_temp
sensor.10_064873_ch_max_setpoint
sensor.10_064873_ch_water_pressure
binary_sensor.10_064873_dhw_enabled
binary_sensor.10_064873_fault_present

I can't see anything on the ramses_cc side that would make these unavailable but I do notice that they are also no longer available in my "production" setup so I would suspect a recent ramses_rf change?

trvrnrth commented 10 months ago
water_heater.stored_hw
sensor.01_145038_hw_heat_demand

I suspect that this will be because the DhwZone is not getting picked up from a system at https://github.com/zxdavb/ramses_cc/blob/db1f60e60a779c1d964a40dd321e342684d56885/custom_components/ramses_cc/broker.py#L186

I can PR something that should resolve these but unfortunately don't have a DHW system to test against.

trvrnrth commented 10 months ago

I believe https://github.com/zxdavb/ramses_cc/pull/131 should resolve discovery of the DhwZones.

trvrnrth commented 10 months ago
sensor.10_064873_boiler_output_temp
sensor.10_064873_ch_max_setpoint
sensor.10_064873_ch_water_pressure
binary_sensor.10_064873_dhw_enabled
binary_sensor.10_064873_fault_present

I can't see anything on the ramses_cc side that would make these unavailable but I do notice that they are also no longer available in my "production" setup so I would suspect a recent ramses_rf change?

I believe the problem lies here: https://github.com/zxdavb/ramses_rf/pull/99

zxdavb commented 10 months ago

Diagnostic sensors (ie. entities with an category of EntityCategory.DIAGNOSTIC) are not included in the default dashboard.

That I did not know!

The change made in https://github.com/zxdavb/ramses_cc/commit/bba4b06b060c02aa3ee62615a2f73a53e5bea7a0 could probably be moved to the base RamsesBinarySensor as there's no harm doing the cast for all entities but otherwise seems correct.

I agree completely - I pulled it out partly because I am becoming a big fan of strict typing.

Certainly, the issue with https://github.com/zxdavb/ramses_cc/commit/09ef8dd2d0c5d41ca27a4126cfc2d5c0c21f5dde would have been picked up via mypy.

binary_sensor.01_145038_schema is renamed binary_sensor.01_145038_status. I thought we'd had a conversation about that on a previous PR but I can't find it at the moment.

I think you're right - I had that in the back of my head - was going to look at it next.

I can't see anything on the ramses_cc side that would make these unavailable but I do notice that they are also no longer available in my "production" setup so I would suspect a recent ramses_rf change?

You're right again - I alluded to this in the HA forum (do you keep an eye on that?) - I suspect it has something to do with changes to use_native_ot:

ramses_cc:
  ramses_rf:
    use_native_ot: always  # always, prefer (default), avoid, never
zxdavb commented 10 months ago

I can PR something that should resolve these but unfortunately don't have a DHW system to test against.

There are a couple of ways around this.

But what I really need to do is setup some tests.

zxdavb commented 10 months ago

Diagnostic sensors (i.e. entities with an category of EntityCategory.DIAGNOSTIC) are not included in the default dashboard.

I think every device should have one - and only one - non-DIAGNOSTIC attr.

This will complicate the table - main attr is temperature for THM, but heat_demand for TRV.

trvrnrth commented 10 months ago

You're right again - I alluded to this in the HA forum (do you keep an eye on that?) - I suspect it has something to do with changes to use_native_ot:

I went looking: https://github.com/zxdavb/ramses_rf/pull/99

trvrnrth commented 10 months ago

I think every device should have one - and only one - non-DIAGNOSTIC attr.

That seems reasonable.

This will complicate the table - main attr is temperature for THM, but heat_demand for TRV.

That shouldn't be too terrible; there will be a small amount of duplication but probably nothing horrific. If necessary the rf_class on the description can also accept a union (ie. rf_class=DeviceClassA | DeviceClassB)

zxdavb commented 10 months ago

I went looking: https://github.com/zxdavb/ramses_rf/pull/99

Wow! Too quick! Thanks.

~Now: how did that get past mypy?~

zxdavb commented 10 months ago

I have added some typing to ramses_cc, so that is passes a basic mypy check.

Sadly, you'll need to merge it into your work - sorry for making work, but I have learned that strict typing is the way forward - it simply prevents bugs.

zxdavb commented 10 months ago

@trvrnrth Would be good if you could remember to:

before you commit (I am not sure if the workflow forces you do do this).