Hue motion sensors + remotes: custom component

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”.

Anyone got a work around?

Thanks!

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? :slight_smile:

I have the FOH switches, not the tap…but same idea.

- id: dinette_light_switch_control
  alias: "Dinette Light Switch Control"
  trigger:
    - platform: state
      entity_id: remote.dinette_switch
  condition:
    - condition: state
      entity_id: remote.dinette_switch
      state: 'left_upper_press'
  action:
    ...

That worked! Thanks a lot man! Have a great weekend!

Hey guys,

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.

Thank you.

Hi,

Trying to add my hue remotes with the Hue-remotes-HASS integration v0.1.

Config:
hue:
bridges:
- host: 192.168.x.x
allow_unreachable: true
allow_hue_groups: true

remote:

  • platform: hueremote

Gettings this error:

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’

HA info:
python_version 3.6.9
version 0.103.6

Any tips?

After upgrading HASS to 0.107 and “Hue sensor advanced” to V3.0, my Hue Smart Buttons are gone.

E.g. “remote.hue_smart_button_1” is “unavailable”, and I cannot find it under another name. What can I do to make them work again?

Had the same issue. See #1150

You will need to install a new component because sensors and remotes got split. See #1153

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?

Yes, you can remove the hue sensor integration if you only use it for remote entities. I did that too.

Also see this (from the developer):

1 Like

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.

1 Like

next HA will have the switches integrated (tap switch and dimmer switch, not sure about FOH or smart button though)

1 Like

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.

check: https://github.com/home-assistant/core/pull/33277
and https://github.com/home-assistant/core/pull/33476

didn’t checkup on this the last couple of changes, so please read, and see what the update will bring :wink:

(I’ll hold on to the CC for a while, because core Hue entities go unavailable too often to be reliable for automations and other logic in my setup)

1 Like

That’s how I got my Philips friend of hue wallswitch (Feller) running. The following functions work perfectly:

  • on/off on the same button
  • on/off same device on different wallswitch
  • use 12 different trigger on 4 buttons
    • 4 release (short push)
    • 4 press (long push)
    • both upper button together (release + press)
    • both lower button together (release + press)
  • the press and release trigger will not double triggering, by using just the press

Hey guys,

I’ve seen this question been asked multiple times but haven’t found an answer yet.

How can we trigger automations based on double or triple button presses on dimmer switch?

Thank you

update on this:

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.)

1 Like

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.