Hue motion sensors + remotes: custom component

Awesome! Thanks for your reply.

Hi,
I just installed the custom component and it works very well!

However, i’ve got an issue and hope to get some advice here.
Is there any way to move blind position 10% down when switch 4_click_up button pressed?
I currently have the following automation:

      alias: 'Test switch'
      trigger:
      - entity_id: sensor.home_switch
        platform: state
        to: '4_click_up'
      action:
        service: cover.set_cover_position
        data_template:
          entity_id: "cover.office_blinds"
          position: "{{ state_attr('cover.office_blinds', 'current_position')|int +10}}"

the problem with this one is that when state is aready 4_click_up it does nothing and i need to click other buttons (to change state) in order to move blinds 10% down. I wonder if there are any workarounds?

Cheers,
Alex

I gave up on Hass automations nearly at the start because they were so limiting. Consider using AppDaemon instead.

I don’t know the correct way to do it, but it looks like your script is setup to look for a state change to ‘4_click_up’ from another state. The keyword “to:” is what I’m seeing. Somehow you need to be checking for an event instead of a state change.

I use a REST command to set the sensor’s state to standby as the last step in my automations which use the remote… works well and subsequent presses of the same button are registered as desired:

Perfect, thanks @mjoshd! I wonder what are the chances we going to have this ‘standby’ state implemented in the custom component? If it is in component would be so much easier to set up.

Thank @kestrel i wonder how to check for the event then and what would be the event im looking for?

If you remove the to: '4_click_up', then the automaiton will trigger even if the state stays the same. You could then check the state as a condition instead. Then you shouldn’t have to worry about a standby state or using an event trigger.

1 Like

this solved it, thanks a lot!

Nice! Thanks @claytonjn! Much easier and cleaner than what I was doing. This is why I like this community; folks are very helpful and I learn something new every day. :smile:

1 Like

How can I add clients to the device tracker? It automatically picked up my phone, but not my wife’s phone. We have the exact same setup in the hue app, so we are both connected to the bridge.

Check that on Routines -> Home and Away you have Location aware enabled.

Both our phones has them enabled and greyed out (logged out of hue)

Does the Philips Hue outdoor sensor have a temperature sensor that can be harnessed like the indoor version?

I finally got around to updating to the latest version and have confirmed this still works :grin:

Am I understanding this right? – it looks like the lux value from the Hue sensors is updated at a default 5 minutes IF there hasn’t been any motion to trigger an automatic update? Wondering if we could be able to poll the sensor more often (say every minute) for it’s current lux value.

1 Like

this is not the case: even when switched Off, the sensors report immediate light level change.

1 Like

I have the behaviour you’ve described (even posted a video somewhere in this thread). @Mariusthvdb I think I’ve seen it before, but now it’s once in a 5 minutes for me too.

only thing I could think of to explain is I test with holding my hand over the sensor to see it drop the light level. Might it be that even when the sensor is switched off, it still notices the movement?

I just tried to add a template binary sensor for a washing machine on/off situation and lost all of my sensors motion temp lux everything from this custom component. I think this is the only binary sensor I have added myself.Any ideas why this is happening?

Edit: Sorry everybody I had no binary_sensor entries and the custom component worked and when I finally added binary_sensor: to configuration.yaml I failed to add the -platform: hue entry under it. I have added it now and all sensor data has returned.

I just updated to version 0.88.0 of hassio, and get several messages regarding custom components needing to be in their own folder.

So instead of
custom_components > binary_sensor > hue.py
It needs to be:
custom_components > hue > binary_sensor.py

and also in the same hue folder needs to be device_tracker.py & sensor.py

I have made these changes and all seems to be working and no more errors :slight_smile: