Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some sensors become unavailable if there is a device without a room #321

Closed
TimClement opened this issue Nov 1, 2022 · 7 comments
Closed

Comments

@TimClement
Copy link

When I add an electrical heat switch device without a room, the log shows that Wiser initialisation fails at sensor.py line 891 and none of the signal strength/battery level sensor values are available in HA. The room stat displays and switches are OK.

Related question - does the hub provide access to the heat switch device on/off control though the API, or does it insist on controlling it via a room thermostat? I want to use it as a hard wired smart plug.

@msp1974
Copy link
Collaborator

msp1974 commented Nov 1, 2022

Can you provide the error output just to make sure we fix the right thing.

No you cannot turn it on/off via the api (think Wiser say this will only work with thermostat/temp sensor).

Thanks

@TimClement
Copy link
Author

Sorry for the delay - had to get at the switch and re-join it to the hub. Log details are as follows:

Logger: homeassistant.components.sensor
Source: custom_components/wiser/sensor.py:891
Integration: Sensor (documentation, issues)
First occurred: 10:44:23 (1 occurrences)
Last logged: 10:44:23

Error while setting up wiser platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/wiser/sensor.py", line 127, in async_setup_entry
WiserLTSPowerSensor(data, heating_actuator.id, sensor_type="Power"),
File "/config/custom_components/wiser/sensor.py", line 891, in init
f"LTS Power {data.wiserhub.rooms.get_by_id(data.wiserhub.devices.get_by_id(id).room_id).name}",
AttributeError: 'NoneType' object has no attribute 'name'

@msp1974
Copy link
Collaborator

msp1974 commented Nov 2, 2022

Great. That issue will be fixed in next release. As it has no room, it will name it HeatingActuator x with x being its ID. If you later add it to a room, it will create a new device and entities with the room name. Couldn't find a way to do this otherwise without breaking for others.

@TimClement
Copy link
Author

Thanks - I don't think the change of device if a room is added will be a problem for me, even if Wiser increasesthe limit on the number of rooms. (None left at the moment.)

@msp1974 msp1974 mentioned this issue Nov 4, 2022
@msp1974
Copy link
Collaborator

msp1974 commented Nov 4, 2022

Can you please try out v3.2.2 and see if this is now fixed. Thanks

@TimClement
Copy link
Author

Looks good - all sensors present. Thanks for the fix.

@msp1974
Copy link
Collaborator

msp1974 commented Nov 4, 2022

perfect thx

@msp1974 msp1974 closed this as completed Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants