Hue motion sensors + remotes: custom component

Sure. v0.8 hue.py copied into custom_components/huesensor and renamed to sensor.py.

Config.yaml:

hue:
  bridges:
    - host: 192.168.1.xxx
      allow_hue_groups: false

sensor:
  - platform: huesensor
    ip_address: 192.168.1.xxx
    token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1 Like

I do also have problem with the hue sensors after upgrading to 0.89.

I have downloaded the three new files and placed them at custom_components/huesensor/

When I in my binary_sensor.yaml files add the line - platform: hue, I receive an error saying: Configuration invalid CHECK CONFIG Platform not found: binary_sensor.hue

What do I do wrong? the Hue Hub works with my lights so that part should be fully functional?

Configuration need to match the folder structure.
If dir is named huesensor you need to use - platform: huesensor

1 Like

is this hue sensor stuff in the main system - i.e. do i need a custom component?

Wups… That seem to fix my problem… Thank you @ludeeus!

Hey M or anybody who kind of knows what there doing I have been using this code to disable, enable the motion sensors as a command line switch:

  bedroom_sensor_switch:
    friendly_name: 'bedroom motion detector switch'
    command_on: >
      curl -X PUT -d '{"on":true}' "http://192.168.1.10/api/redacted/sensors/3/config/"
    command_off: >
      curl -X PUT -d '{"on":false}' "http://192.168.1.10/api/redacted/3/config/"
    command_state: 'curl http://192.168.1.10/api/redacted/sensors/3/'
    value_template: '{{value_json.config.on}}'

and I noticed this error (?lately)

Error parsing value: ‘value_json’ is undefined (value: None, template: {{value_json.config.on}})

Is there something wrong with the code or is it something else. The switches still appear functional in my frontend

Thanks all

NVM

Mariusthvdb provided the answer here but kind of a weird switch in the front end now
https://community.home-assistant.io/t/toggle-phillips-hue-sensors-on-off-from-hass/36734/13

Is this one supported in the component? The new Philips outdoor sensor that is :slight_smile:

Yes, the outdoor sensor looks just like the indoor sensor in HA. Works like a charm once you have the custom component sorted.

1 Like

@ajoyce I have the same problem. How have you downgraded? Just use the old tutorial?

Yes - go to the Github page, go to Releases and get v0.8 there - the old instructions are included in the zip file

1 Like

No problems with the custom component?

you have one installed?

could you please share a screenshot of the attributes it has? I can’t find any documentation from Philips showing what features it supports, other than motion (lx, light level, temperature, battery, etc etc)

I mean this more-info:

03
a screen from the api too would be great please?

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

Is this good enough?

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

1 Like

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.

1 Like

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 ?

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

1 Like

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?

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

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: