ZacheryThomas / homeassistant-smartrent

Home Assistant Custom Component for SmartRent Locks 🔐, Thermostats 🌡, Sensors 💧 and Switches💡
MIT License
82 stars 3 forks source link

Changing Thermostat Mode #3

Closed snepple closed 2 years ago

snepple commented 2 years ago

It appears that the SmartRent API is being called to change the Thermostat mode to “Cool”. This is happening repeatedly and without the temp or mode being changed in Home Assistant. I have not found any corresponding information in the Home Assistant log.

ZacheryThomas commented 2 years ago

Can you try adding this config to the bottom of your homeassistant configuration.yaml and then restarting your HA instance?:


logger:
  default: warning
  logs:
    custom_components.smartrent: debug
    smartrent: debug

This should allow us to get some more logs out of the smartrent integration.

If the issue happens again you can try sending the logs to me and I can try to figure out whats happening.

snepple commented 2 years ago

Logs from around the time it changed to cool mode:

2022-01-11 15:41:33 INFO (MainThread) [smartrent.lock] Updating DoorLock 2022-01-11 15:41:33 INFO (MainThread) [smartrent.device] Front Door - Lock Notifications -> notifications -> KEY_OR_THUMBTURN_UNLOCK 2022-01-11 15:41:33 INFO (MainThread) [smartrent.lock] Updating DoorLock 2022-01-11 15:41:34 INFO (MainThread) [smartrent.device] Thermostat ThermostatMode -> mode -> cool
2022-01-11 15:41:34 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 15:41:35 INFO (MainThread) [smartrent.device] Thermostat ThermostatSetpoint -> cooling_setpoint -> 70
2022-01-11 15:41:35 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 15:43:34 INFO (MainThread) [smartrent.device] Thermostat MultiLvlSensor -> current_temp -> 70
2022-01-11 15:43:34 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 15:43:51 WARNING (MainThread) [custom_components.mail_and_packages.sensor] External URL not set in configuration. 2022-01-11 15:44:21 ERROR (MainThread) [homeassistant.components.litterrobot.hub] Unexpected error fetching litterrobot data: 'str' object has no attribute 'get' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/usr/src/homeassistant/homeassistant/components/litterrobot/hub.py", line 30, in _async_update_data await self.account.refresh_robots() File "/usr/local/lib/python3.9/site-packages/pylitterbot/account.py", line 79, in refresh_robots robot_object = next( File "/usr/local/lib/python3.9/site-packages/pylitterbot/account.py", line 81, in lambda robot: (robot.id == robot_data.get(LITTER_ROBOT_ID)), AttributeError: 'str' object has no attribute 'get' 2022-01-11 15:44:30 WARNING (Thread-52) [roombapy.roomba] Unexpectedly disconnected from Roomba 192.168.1.173, code The connection was lost 2022-01-11 15:45:51 ERROR (MainThread) [pylitterbot.account] Unable to retrieve your robots 2022-01-11 15:46:56 ERROR (MainThread) [pylitterbot.account] Unable to retrieve your robots 2022-01-11 15:49:00 WARNING (MainThread) [custom_components.mail_and_packages.sensor] External URL not set in configuration. 2022-01-11 15:51:07 ERROR (MainThread) [frontend.js.latest.202112291] http://homeassistant.local:8123/dwains-dashboard/home:0:0 Uncaught 2022-01-11 15:51:07 ERROR (MainThread) [frontend.js.latest.202112291] http://homeassistant.local:8123/dwains-dashboard/home:0:0 Uncaught 2022-01-11 15:51:07 ERROR (MainThread) [frontend.js.latest.202112291] http://homeassistant.local:8123/dwains-dashboard/home:0:0 Uncaught 2022-01-11 15:51:07 ERROR (MainThread) [frontend.js.latest.202112291] http://homeassistant.local:8123/dwains-dashboard/home:0:0 Uncaught 2022-01-11 15:52:22 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472910241216] Error handling message: Unauthorized 2022-01-11 15:52:23 ERROR (MainThread) [frontend.js.latest.202112291] http://192.168.1.96:8123/lovelace/default_view:0:0 Uncaught 2022-01-11 15:52:23 ERROR (MainThread) [frontend.js.latest.202112291] http://192.168.1.96:8123/lovelace/default_view:0:0 Uncaught 2022-01-11 15:52:23 ERROR (MainThread) [frontend.js.latest.202112291] http://192.168.1.96:8123/lovelace/default_view:0:0 Uncaught 2022-01-11 15:52:23 ERROR (MainThread) [frontend.js.latest.202112291] http://192.168.1.96:8123/lovelace/default_view:0:0 Uncaught 2022-01-11 15:52:27 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472910241216] Error handling message: Unauthorized 2022-01-11 15:54:09 WARNING (MainThread) [custom_components.mail_and_packages.sensor] External URL not set in configuration. 2022-01-11 15:57:39 INFO (MainThread) [smartrent.device] Thermostat MultiLvlSensor -> current_temp -> 68
2022-01-11 15:57:39 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 15:59:18 WARNING (MainThread) [custom_components.mail_and_packages.sensor] External URL not set in configuration. 2022-01-11 16:02:32 INFO (MainThread) [smartrent.device] Thermostat MultiLvlSensor -> current_humidity -> 34
2022-01-11 16:02:32 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 16:12:39 INFO (MainThread) [smartrent.device] Thermostat MultiLvlSensor -> current_temp -> 67
2022-01-11 16:12:39 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 16:35:19 INFO (MainThread) [smartrent.device] Thermostat MultiLvlSensor -> current_temp -> 66
2022-01-11 16:35:19 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 17:03:05 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472910241216] Error handling message: Unauthorized 2022-01-11 17:03:39 ERROR (MainThread) [frontend.js.latest.202112291] http://192.168.1.96:8123/frontend_latest/app.fcb47474.js:230:2283 Uncaught TypeError: Cannot read properties of null (reading 'push') 2022-01-11 17:03:39 ERROR (MainThread) [frontend.js.latest.202112291] http://192.168.1.96:8123/frontend_latest/app.fcb47474.js:230:2283 Uncaught TypeError: Cannot read properties of null (reading 'push') 2022-01-11 17:03:43 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472910241216] Error handling message: Unauthorized 2022-01-11 17:03:48 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472910241216] Error handling message: Unauthorized 2022-01-11 17:03:57 INFO (MainThread) [smartrent.device] sending payload ["null", "null", "devices:1913401", "update_attributes", {"device_id": 1913401, "attributes": [{"name": "mode", "value": "heat"}]}] 2022-01-11 17:03:58 DEBUG (MainThread) [smartrent.device] Possible issue during send_payload: "server rejected WebSocket connection: HTTP 403" Refreshing token and retrying 2022-01-11 17:03:58 INFO (MainThread) [smartrent.utils] Refreshing tokens with refresh token 2022-01-11 17:03:58 INFO (MainThread) [smartrent.utils] Tokens refreshed! 2022-01-11 17:04:01 INFO (MainThread) [smartrent.device] Thermostat ThermostatMode -> mode -> heat
2022-01-11 17:04:01 INFO (MainThread) [smartrent.thermostat] Updating Thermostat 2022-01-11 17:04:06 INFO (MainThread) [smartrent.device] sending payload ["null", "null", "devices:1913401", "update_attributes", {"device_id": 1913401, "attributes": [{"name": "heating_setpoint", "value": "69.0"}]}] 2022-01-11 17:04:08 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281472910241216] Error handling message: Unauthorized

ZacheryThomas commented 2 years ago

Do you see anywhere in the logs where it says sending payload? That message should appear whenever the integration is sending commands to smartrent.

Like in my logs heres when I change the thermostat in homeassistant to cool:

2022-01-11 21:28:12 INFO (MainThread) [smartrent.device] sending payload ["null", "null", "devices:2216425", "update_attributes", {"device_id": 2216425, "attributes": [{"name": "mode", "value": "cool"}]}]
2022-01-11 21:28:14 INFO (MainThread) [smartrent.device] Thermostat  ThermostatMode  -> mode            -> cool
2022-01-11 21:28:14 INFO (MainThread) [smartrent.thermostat] Updating Thermostat

If that isn't showing up, maybe your thermostat already has some automated schedule set up or you have another automation set up in the smartrent app itself that is changing the thermostat mode.

ZacheryThomas commented 2 years ago

Hello! Just checking in. Are you still encountering this issue?