Hey guys, how does everyone do automations with theses?
I have a Hue Tap switch linked. But when trying to do automations in Node-Red using the “State_Changed” home asssitant node. it doesn’t detect the same button pressed twice.
What I mean is,
If I press. Button 1 then button 2. All works.
If I press Button 1, then again Button 1. It doesn’t send the second signal, since there wasn’t a “change”.
I don’t use Node-Red for automations but the if you hit the same button two times in a row the state isn’t changing so it stands to reason that “State_Changed” wouldn’t work. I’m guessing that you need to use an events node.
For regular HA automations using a to: in the trigger won’t work because the state isn’t changing, but if you just have platform: state and entity_id: in the trigger and then put to: as a condition it will work.
I tried figuring this out with the Home-Assistant automations (Which I’ve barely used) and am having a lot of trouble finding “platform” under Trigger Type. Could you perhaps give me a quick screenshot of how you created an automation with a hue button?
is it OK that after installing Hue-remotes-HASS I can see the Entity of my Hue Dimmer Switch, but there is no Device? With Official Hue Integration, I have both Devices and Entities.
Btw, everything works as expected, I can use Dimmer Switch Entities in Home Assistant Automations using the State “1_click_up” or similar.
Log Details (ERROR)
Tue Mar 31 2020 15:02:33 GMT+0200 (Central European Summer Time)
Error while setting up platform hueremote
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File “/usr/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/home/homeassistant/.homeassistant/custom_components/hueremote/remote.py”, line 40, in async_setup_platform
config.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL),
File “/home/homeassistant/.homeassistant/custom_components/hueremote/data_manager.py”, line 159, in async_add_platform_entities
async for is_new, model, dev_id, _ in self._iter_data(platform_models):
File “/home/homeassistant/.homeassistant/custom_components/hueremote/data_manager.py”, line 56, in _iter_data
await bridge.sensor_manager.coordinator.async_request_refresh()
AttributeError: ‘HueBridge’ object has no attribute ‘sensor_manager’
Thanks mate, you saved my day! After adding the hueremote-platform it’s working again. Does that mean I can remove the huesensor-platform when I’m only using the custom component(s) for Smart Buttons?
That part is confusing me. Last time I checked the Hue Smart Button was not supported by the official integration, which was the reason to start using this integration in the first place. If this has changed, I’m unable to find any information about it.
This part is about the hue sensor integration, (not about the new separated hue remote integration). So what you need (hue remote) is not part of the official integration.
If you only use remote entities you should be save to remove the hue sensor integration, replace it by the hue remote integration and everything should be fine.
Ok, so after updating to 0.108 the hue remote custom component won’t be needed any more (for the devices you mentioned).
I guess there will be doubled entities if we update without removing the component before. Am I right? What’s the right way to update without having double entities after it. Also it would be interesting I the official integration generates the same entity names (so that all automations still work).
no, the automation will not work, because the remotes won’t be the same (hue ‘remotes’ dont act like true HA remotes, they probably will become sensors again…), and use a different approach for the events.
core Hue devices (not entities) for remotes are now available. Events are registered, and can be used for the automations (note that the polling frequency is not immediate, but 1-5 seconds)
you can bring the events to the frontend using @azogue 's CC Eventsensor:
he even made a CC to up the polling frequency if you must (do at your own risk, since this sets the core Hue updating to a higher frequency that adviced by Balloob/Core dev team.)
You have to remove to and from from the state trigger and then use state as a condition instead. For double press you can compare current state to previous state to see if they’re the same. Triple press would be a lot more difficult - you’d probably have to create an entity to store intermediate press states for each switch, or use Appdaemon or NodeRed.
One thing to note is that because only events are fired and no entity is created nothing is updated in the state machine and therefore there’s no way to compare current state to previous state - this is especially important with the kinetic switches where there is no hold state; you get a press state and release state and you need to compare the time difference between the two to filter between a quick press and a hold.