jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
198 stars 48 forks source link

hubitat.send_command only working on devices attached to most recently reloaded hub in HA #215

Closed glocklol closed 1 year ago

glocklol commented 1 year ago

Multiple Hubs, both running makerapi. Both hubs added to HA. While devices and entities work as they should for the most part, upon calling the service 'hubitat.send_command' against an entity on the not-most-recently-reloaded hub, the following error is thrown:

Logger: homeassistant.helpers.script.websocket_api_script Source: custom_components/hubitat/services.py:73 Integration: Hubitat (documentation, issues) First occurred: 10:38:32 PM (10 occurrences) Last logged: 11:34:32 PM

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Invalid or unknown entity 'switch.garage_siren' websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Invalid or unknown entity 'switch.garage_siren_alarm' websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Invalid or unknown entity 'light.yard_light_on_garagehub' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1849, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/config/custom_components/hubitat/services.py", line 81, in send_command entity = get_entity(service) File "/config/custom_components/hubitat/services.py", line 73, in get_entity raise ValueError(f"Invalid or unknown entity '{entity_id}'") ValueError: Invalid or unknown entity 'switch.garage_siren'

jason0x43 commented 1 year ago

This is fixed in v0.9.6.