Hue motion sensors + remotes: custom component

It’s all working now with the “New Config” code but didn’t work with the “old config” code.

Not broken into separate files yet. I am very green as i’ve only set it up a week ago!

1 Like

Thanks for the reply and I apologize for my late reply. I also had experienced major delays when running HA on my Rpi3. Ever since I moved my installation to a VM on my Proxmox server (running on a Dell R210ii), I saw no more delays from the service as a whole. Heck… I can restart the VM in about 10 seconds. lol.

I just picked up a Hue motion sensor the other day so I’ll play around with it and HA and see what the delays are. Thanks.

1 Like

Moving on to my next brain injury - automation has been setup and looks to run in the logbook nicely; however, the service it calls for the light (it’s names correctly as far as I can tell) turns the light on; however, the light doesn’t turn on itself. Interestingly in the logbook it shows an icon as a little hamburger menu with a triangle rather than the light bulb when I turn the instance on with the entity switch.

configuration.yaml looks like this

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: -37.8071
  longitude: <longgggg>
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Australia/Melbourne
  # Customization file
  customize: !include customize.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Show the introduction message on startup.
introduction:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
  base_url: &********
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem


# Sensors
binary_sensor:
  - platform: hue_custom
sensor:
  - platform: hue_custom
  - platform: yr
device_tracker:
  - platform: hue_custom

# Text to speech
tts:
  - platform: google

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

#Allow the configurator into the panel
panel_iframe:
  configurator:
    title: Configurator
    icon: mdi:wrench
    url: https://<IPAddress:port>
#Allow IOS companion
ios:

automations.yaml looks like this

- id: '1552993768853'
  alias: Pantry Light
  trigger:
  - entity_id: binary_sensor.pantry_motion_sensor
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: light.pantry_light
    state: 'off'
  action:
  - data:
      entity: light.pantry_light
    entity_id: light.pantry
    service: homeassistant.turn_on

and finally it’s throwing up some errrors in the home-assistant.log looks like this

and a photo of the automations logbook
automations%20logbook

Thanks again in advance! It’s all slowly making sense; however, these errors grind me to a halt :frowning:

use:

- id: 'Pantry light'
  alias: Pantry Light
  trigger:
    platform: state
    entity_id: binary_sensor.pantry_motion_sensor
    to: 'on'
  condition: [] #not really necessary
    #condition: state
    #entity_id: light.pantry_light
    #state: 'off'
  action:
    service: light.turn_on
    entity_id: light.pantry_light
     
1 Like

Thanks for answering. No it tends to come and go. I occasionally see messages that say HA cant connect to my bridge IP address so maybe that is related. All in all I’m thinking some issues are related to my infrastructure but of course these things can be difficult to nail down. Have I outgrown my pi and should I move on to a NUC(I ask myself). Is my router capable of handling my increasing number of devices or is HA in all of its lightning evolution the problem. In any case It seems like the template should define what to show when it gets a return of “nothing” like unavailable like with your lights but this is beyond my ability to template so far. You really have to become kind of become a small scale IT department when you take this on but its fun. My fiance thinks I’m crazy though lol. Still looking for that one automation that convinces her that I’m not wasting the hours I pour into this.

this is a very well down issue with the way HA integrates Hue, and there are many threads on this, it has not been solved yet. The unavailable Hue lights are a real pain…

to give you an idea…

Thank you very much - Please, let me know why the code didn’t work?

This has made everything absolutely so confusing now because I built that exact automation through the automations “wizard” you could call it.

Reading your code it all makes alot of sense, I just can’t workout why the other method would not work?

could you also let me know because I’ve found nothing too detailed; is there some documentation on the programming langauge and tags/etc you can use for them all? (Like for example the timer function)

thanks!

this was the main reason:

  action:
  - data:
      entity: light.pantry_light
    entity_id: light.pantry
    service: homeassistant.turn_on

the line with the entity: light.pantry_light shouldn’t have been there.

I always write my automations manually for I have an ‘order’ fetish, and am a sucker for as short as possible… It helps me writing correct automations, and spot errors as good as it gets. Always using the same order, with the corresponding spaces and indent (crucial in YAML) helps me prevent issues. But it’s personal of course. There are many ways to reach the same goal…

start here: Automating Home Assistant - Home Assistant and find your way in the components documentation: Timer - Home Assistant

I made the changes recommended in this thread and my Hue Switches are now working once more - but I have lost the ability to get them to display in their own tab.

e.g. I see an entry under ‘States’: sensor.conservatory_switch, and my automation scripts that use that sensor work, yet my groups.yaml contains (cut down for clarity)

default_view:
view: true
icon: mdi:home
entities:
- group.Hue

and

Hue:
view: yes
name: Hue Switches
entities:
- sensor.conservatory_switch

The tab shows nothing - whereas it used to show an entry to reflect each switch I have configured.

Is that kind of state display no longer supported, or does it require a config change?

TIA
Steve

Has anyone noticed any difference with Hue motion sensor on older version where they are sensors and on the newer version where they are binary_sensors?

I have automation that turns off lights according to humidity and with sensor that works really well but when motion sensors are binary_sensors once or twice a day the automation is not working and the lights are turning off even when there is motion. This is completelly fixed when downgraded back to 1.0.2 where motion sensors are just sensors.

I have the same problem with motion sensors not always triggering lights.

Hey everyone,

Can anyone help me with the settings on the motion sensor - if I stay in the same room it clears the motion but will not reactivate it… Is there a way to get around this?

If I completely leave the room and wave my hand in front when it goes to “clear” it detects movement again.

If I am always standing in the room and move around it will not go from a clear state to a detected state.

Could this be to do with the sensitivity? I was trying to find the setting; however, didn’t have any luck…

Current’y my automation starts to light on start on, while to turn the light off it waits for the sensor to go off for 30 seconds than changes the state of the light… (in theory anyway)

Thanks in advance.

this sound a bit awkward. I do recognize the motion sensors not reacting very quickly after an earlier motion detection sometimes, but you shouldn’t have to ‘leave the room’…

do play with the sensitivity, it does make a lot of difference. So much in fact, I have created a system to automate setting these in scripts for night time, activity etc etc. The outdoor sensor is even more sensitive in my experience and practically almost always set to least sensitive (it has more positions than the inside sensors)

You should be able to see when the motion sensors state is back to off, if you check the states in the frontend, either in the card, or in the more-info screen. It responds rather well, and you can see its behavior perfectly. Up to you if that responsiveness is adequate for your automation.

This is what I thought too…

What are the sensitivity parameters which can be used? 1 - 10?

End of the day this is the pantry, so it’s not going to hurt to be ultra sensitive.

low, medium high (0,1,2)

34

3 Likes

What is that card? custom card or you create that?

1 Like

Oh, interesting - it’s already on sensitivity 2.

Odd that with even constant movement the sensor doesn’t hold it’s “on” state and it turns it to “off” and won’t change back to the “on” state afterwards for a delayed period.

If I wave my arm into the room infront of the sensor and turn the state to “on” then remove my arm for approximately 10-15 seconds the state will change from “off” to “on” again.

It seems an issue with when the sensor see’s constant or very frequent movement…

So in my opinion, it’s not that the sensor is sensing too slowly, it’s that the sensor is not remaining in the “on” state or triggering at faster intervals…

I only have the pantry sensor setup for 30second, could this time limit be too short for the sensor to handle?

Could someone let me know if this is common behavior or something wrong with my setup?

I have the exact same problem when motion sensors are set as binary_sensors in the newest version. So the problem is not the sensitivity, there is a bug in either in CC or HA. It works flawlessly in 1.0.2 but not in 1.0.4.

made that. small Tiles setup, with rather a complicated Hue logic behind it…

not sure about that. I have 2 setups both with version 1.04. ha84.3 and ha90.2. Both work as expected.

if you are on the latest HA version, are you sure you have setup the new custom component folder and naming correctly (Great Migration)?

I do notice that the angle and coverage of the Hue sensor can be a bit precise: one of my sensors is on a shelf in the Auditorium (see screenshot), looking out over my couch. If I wave my arm, it won’t always detect, but when I stand up, it immediately responds. Its on for about 10 seconds and then returns to its Off state. If I then standup again, it immediately detects.

23