Hue motion sensors + remotes: custom component


#835

what’s weird about it?

11

Ive changed the switches a bit:

      laundry_motion_sensor_switch:
        friendly_name: 'Laundry motion sensor switch'
        command_on: >
          curl -X PUT -d '{"on":true}' "http://192.168.1.212/api/redacted key/sensors/22/config/"
        command_off: >
          curl -X PUT -d '{"on":false}' "http://192.168.1.212/api/redacted key/sensors/22/config/"
        command_state: !secret get_laundry_config
        value_template: >
          {{value_json.config.on}}

and use this customization:

    switch.laundry_motion_sensor_switch:
      templates:
        icon: >
          if (state === 'on') return 'mdi:toggle-switch';
          return 'mdi:toggle-switch-off';
      assumed_state: false
      group:
        group.philips_motion_sensor_switches:
          friendly_name: Laundry motion

#836

Is this good enough?

Exactly the same features as the indoor one. Probably same hardware too, just different casing.


#837

None. Was using v0.8 before. Only issues are a few more errors in the log but none that are actually causing problems. I prefer this to the problems described using the latest version of the CC.


#838

Thanks. Fancy :sunglasses:

Ahem I’ll just copy this …like pretty much everything else I have in my config lol. At least its starting to make some sense.

Just to confirm are you using:

    command_state: !secret get_laundry_config
    value_template: >
      {{value_json.config.on}}

or something like

value_template: >-
  "{{ is_state('sensor', 'on') }}"

Edit:

The second way doesnt have the correct initial state shown in the front end and the first way I think gave me an error so ?


#839

thank you very much for confirming!
ordered one;-)


#840

just to be sure: the command_state: with the !secret needs the correct command in the secrets.yaml file of course, did you do that?

what {{value_json.config.on}} does is check the value of the attribute on, to see if its true or false. theoretically you could use other value_templates, but this should really be it, in combination with the command_state

what error do you see?


#841

din_liv_rm_sensor_switch:
friendly_name: ‘dining room motion detector switch’
command_on: >
curl -X PUT -d ‘{“on”:true}’ “http://192.168.1.10/api/redacted/sensors/9/config/
command_off: >
curl -X PUT -d ‘{“on”:false}’ “http://192.168.1.10/api/redacted/sensors/9/config/
command_state: ‘curl http://192.168.1.10/api/redacted/sensors/9/
value_template: ‘{{value_json.config.on}}’

I have been lately with my secrets.yaml especially bc allot is in flux right now. This is what I had originally but I had the error. Ill put it back and get back to you about the error


#842

if anything, be ware of simply copying from this community posts, editors tend to change the quotes into curly quotes, and the HA yams engine doesn’t except these.

Just look at your post and see all left quotes to be incorrect now.

Not saying that caused your error, but it would now :wink:


#843

:neutral_face: confused

Which quotes are wrong?

It passes check config in the frontend?

**''**
''

’ ’
‘dining room motion detector switch’

I’ll keep an eye on it but I think I see what you mean copying back and forth from notepad ++ to these posts


#844

09

and all the other quotes really that start and finish, should be

 ' '

#845

Apologies, having an issue on getting my Motion Sensor to show up in HA after re-installing. I barely have any idea on how to run anything Python related as mentioned here:

Parse the json file using the hue_sensors package and report the device ID (e.g. RWL_06-02) that is causing your issue.

Querying the bridge like it says here: Hue-sensors-HASS shows my sensor under the ‘sensors’ section: https://i.imgur.com/VL3pMPk.png

But it doesn’t show up in HASS anymore. It used to come up as sensor.front_door_motion_sensor. Doesn’t seem like I get any errors on startup either. My other Hue lights (normal integration) work fine.


#846

Hi. I’m running 0.88.2 and I have custom_components\sensor\hue.py installed. I’d like to remove it. What steps should I follow? Should I delete the entire custom_components folder (with it sub-folder and content), remove any config file references and then reboot?


#847

Also cant get this custom component to work. Since latest releases of HA you need to change the folder names from sensor/hue.py to hue/sensor.py and download newest version I think. But anyway, component does not work. I am getting an error saying:

Unable to find platform hue. Search path was limited to path of component: homeassistant.components

So no idea how to get it back running. Config looks like this:

sensor:
  - platform: hue

Hue system itself is up and running…

And the docu mentioned in the the source is no longer available:
https://www.home-assistant.io/components/sensor.hue/

Regards


#849

What worked for me was renaming the folder from /hue/ to /hue_custom/ and then the config needs to be

sensor:     
  - platform: hue_custom

#850

Yup. hue_custom and no errors at all. Just a warning that a custom component hasnt been tested.

Still no motion sensor :frowning:


#851

They changed motion sensors from sensors to binary_sensors so it should probably be called…

binary_sensor.front_door_motion_sensor

#852

Which is why I tried finding a combination of everything, “front” or “door” etc… :slight_smile: (from the entities page)


#853

to get motion sensors you should have this in your config…

binary_sensor:
  - platform: hue_custom

#854

I was like, “of course” and opened up Configurator to show screenshots but then I remembered I had copied my old setup’s “binary_sensor.yaml”… and just remembered I didn’t put a binary_sensor: !include :frowning:

My bad, and thanks :slight_smile:


#855

hue_custom did it for me. Thanks @craigulator