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

Buttons stopped working #235

Closed
achecchia opened this issue Jan 1, 2024 · 20 comments
Closed

Buttons stopped working #235

achecchia opened this issue Jan 1, 2024 · 20 comments
Labels
bug Something isn't working

Comments

@achecchia
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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

@achecchia
Copy link
Author

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

@achecchia
Copy link
Author

i ended up rolling back, got things restored

@jason0x43
Copy link
Owner

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

@jason0x43 jason0x43 added the bug Something isn't working label Jan 2, 2024
@730522js
Copy link

730522js commented Jan 2, 2024

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
Copy link

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
Copy link

sib321 commented Jan 2, 2024

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
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link
Owner

@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
Copy link

regius10 commented Jan 3, 2024

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
Copy link
Owner

@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
Copy link

regius10 commented Jan 3, 2024

@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
Copy link
Owner

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
Copy link

regius10 commented Jan 5, 2024

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

@regius10
Copy link

regius10 commented Jan 8, 2024

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

@jason0x43
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants