jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
189 stars 46 forks source link

Buttons stopped working #235

Closed achecchia closed 6 months ago

achecchia commented 6 months ago

Since i updated last night, none of my buttons are working. I have lutron keypad buttons in Hubitat, exposed to HA and automations programmed within HA. prior to updating, all buttons worked. now none of them do. Hubitat sees the button presses, but HA does not.

jason0x43 commented 6 months ago

Based on a similar issue with switches (#234), I’m guessing some ids have changed. HA may still be seeing the button presses, but may not be routing them to the existing triggers in your automations.

I’m looking into the issue.

achecchia commented 6 months ago

thanks. here's the logs on my last button push if that helps

Logger: homeassistant Source: components/sensor/init.py:554 First occurred: 10:25:44 AM (4 occurrences) Last logged: 10:28:14 AM

Error doing job: Exception in callback Hub._process_event({'content': {'data': None, 'descriptionText': 'Master Bed A... 1 was pushed', 'deviceId': '787', 'displayName': 'Master Bed A...edside Keypad', ...}}) Error doing job: Exception in callback Hub._process_event({'content': {'data': None, 'descriptionText': 'Master Bed A... was released', 'deviceId': '787', 'displayName': 'Master Bed A...edside Keypad', ...}}) Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/config/custom_components/hubitat/hubitatmaker/hub.py", line 328, in _process_event listener(evt) File "/config/custom_components/hubitat/hub.py", line 475, in handle_event listener(event) File "/config/custom_components/hubitat/device.py", line 178, in handle_event self.update_state() File "/config/custom_components/hubitat/device.py", line 183, in update_state self.async_schedule_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 924, in async_schedule_update_ha_state self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 745, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in _async_write_ha_state state, attr = self._async_generate_attributes() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 786, in _async_generate_attributes state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 751, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 554, in state raise ValueError( ValueError: Invalid datetime: sensor.master_bed_anthony_s_bedside_keypad_last_update_time provides state '2024-01-01 10:25:44.097464', which is missing timezone information

achecchia commented 6 months ago

the strange thing is all my lights AND switches work just fine, nothing was altered with them. This is strictly button related

achecchia commented 6 months ago

correction, there are virtual switches from HE that have the issue others are having, but not physical swicthes.

achecchia commented 6 months ago

i ended up rolling back, got things restored

jason0x43 commented 6 months ago

Excellent. That implies the issue should be easy enough to fix.

730522js commented 6 months ago

I have the same issue. I've noticed that the Hubitat switches (including virtual switches) in HA changed from switch.name into switch.name_power. I've solved my issue by "renaming" all the buttons not working with the proper "new" id "_power". Hope this helps somebody!

jiipee-blob commented 6 months ago

Yep I changes all my automations and stuff to use those new switches per device. Problem solved. Hopefully I do not have to do it all again if there's going to be some kind of changes to fix the issue.

sib321 commented 6 months ago

I've suffered the same issue and have fixed by restoring my last backup.

I'm just posting to say "Thanks" for your hard work keeping this important integration up to scratch!

jason0x43 commented 6 months ago

Switches should be fixed in v0.9.17.

Buttons may be fixed, although I was never able to reproduce any issues with buttons locally, so I'm not sure what the cause was. In local testing, button controllers in v0.9.8, v0.9.12, and v0.9.16 all emit events with the same property values, so it doesn't seem like anything changed there.

If you're still having issues with buttons, how are you using them? Are you using device triggers, or something else?

HomeWiseAdmin commented 6 months ago

The author closed our issue, however the things are not resolved, we have upgraded from 0.9.9 to 0.9.17 as suggested by the author and the issues are still there, switches and contacts get still renamed. We had to go back to 0.9.9 to get everything back. Specially it is worse with virtual switches with dual functions. Please look into it. Thank you

HomeWiseAdmin commented 6 months ago

Also I recommend to author to Add one or more Virtual Devices (Contacts and switches) , or at least one virtual device with dual functionality to your local test environment, this is good for checking current issues as well as for testing the future releases. HPM and hubitat has already a few virtual device with dual/multiple functionality you can add to your test environment. Thank you

jason0x43 commented 6 months ago

@HomeWiseAdmin I only closed your issue because it appeared to be duplicative of other issues, and there wasn't enough detail to easily differentiate it. In particular, a problem with entity naming, specifically with _switch being added to entity identifiers, was raised in #234. However, after looking at it a bit more, I think I see some of what's going on, so I reopened #240.

regius10 commented 6 months ago

Hi, I have 2 Ikea remotes, one Tradfri and one Styrbar. They do register button presses in Hubitat, the remotes are seen by HA but button presses are not registered. they worked fine in Update 0.9.8, but are broken since. I do have some sonoff buttons which work fine, so my guess is only devices with multiple buttons have this issue. Thanks

jason0x43 commented 6 months ago

@regius10 A couple things to try:

  1. open Developer tools in Home Assistant, select Events, and start listening for hubitat_event, then press a button. Does an event show up?

  2. In an automation that uses a button (or in a new automation), add a new button press trigger. Does that trigger work?

If either of the above things work, then HA is processing button press events, but something in the event receiver is still different than in previous versions of the integration.

regius10 commented 6 months ago

@regius10 A couple things to try:

  1. open Developer tools in Home Assistant, select Events, and start listening for hubitat_event, then press a button. Does an event show up?
  2. In an automation that uses a button (or in a new automation), add a new button press trigger. Does that trigger work?

If either of the above things work, then HA is processing button press events, but something in the event receiver is still different than in previous versions of the integration.

Hi Jason, thanks for the quick reply. I am just starting with HA, and I managed to restore a backup with ver. 0.9.8, so I cannot check 1., but I can confirm 2. is not working, as before the restore I tried to redo my automations, and the new triggers did not work either. I did also try to reinstall the devices in HE and re-added them in MakerApi, but that din't work either. Just a heads-up for people who want to restore previous versions: restoring a backup from 5 days ago (in my case) did mess up my energy dashboard, as I lost all the info for the 5 days, so my energy consumption for today basically added al consumption from the last 5 days and all solar production from the last 5 days in a single day. also, pretty much all device history is messed up, so if it's not "burning", it may be a good idea to wait until Jason figures it out and releases a working update. @jason0x43 Many thanks for your hard work in releasing and maintaining the HE integration. I find HA is a much better allrounder for home automation than HE, and being able to use HE as a zigbee/z-wave controller only does help a lot

jason0x43 commented 6 months ago

Is anyone still having button issues with 0.9.17 or 0.9.18? I haven't been able to reproduce any problems locally with button entities or automations, so if there are still issues I'm going to need a bit more information.

regius10 commented 6 months ago

I will test the 0.9.18 at the begining of next week and let you know. unfortunately cannot do it sooner. thanks

regius10 commented 6 months ago

Ikea remotes with multiple buttons (Tradfri/Styrbar) work fine with ver. 0.9.19. Thanks

jason0x43 commented 6 months ago

I'm closing this because it sounds like it's resolved, but I'll reopen if people are still having issues.