Hue motion sensors + remotes: custom component

perhaps offtopic, but does the Tradfri sensors also measure light level (in a room)?

Hi Mauris
I’m afraid its impossible to debug your problems without:

  1. Info about your config, which version of the custom component you are using.
  2. Error logs
    I had the impression this was working for you before…
    Cheers

It was working before, but as mentioned, ive moved a sensor…and changed its name.
There are zero errors, so nothing to show there.

----edit—

i see this now:

Using 8-10-2017 of your component, Hassio 0.60.

ill kill my post on GitHub, since your already here :wink:

You changed its name in the Hue app, correct? What from/to?
Cheers

From Auditorium to Corridor.

btw, ive also changed all pointers in the configfiles from auditorium to corridor for that matter

Hi, you can customise the name displayed in HA, so wouldn’t that be easier…?

hmm, hadn’t thought about that Still, they were named Auditorium before, so that had to be changed. Customizing them is only cosmetically, and more prone to forgetting or debugging issues…

I would have believed you’re CC to make this all automatic? How come the old names can still be there while they aren’t created anywhere?

Marius

my Bad, im so sorry…

I completely missed the template sensors created in my sensor_template.yaml…

Thanks anyways, because i only found them because you asked for error-logs…

here they are:
28

Thanks!

Glad thats fixed :+1:

#metoo

anynideas how to get the time representation more readable? preferably time first then year/month?

above shows many 2017, which is not very helpful info -)

In python I would split on the comma character, and take the end. In yaml, I wouldn’t know as I do the bare min in yaml… last_updated: 2017-12-28,15:48:23

timestr = 'last_updated: 2017-12-28,15:48:23'
timestr.split(',')[-1]

'15:48:23'
1 Like

Hi Mark,
Since im learning Python as we speak, and my efforts on the contrary have been more yaml related lately…
where do i place this in the hue_sensor.py?
There’s no timestr as i parse it right now?

If you’re planning on manually editing, the line is here.

I was suggesting you add this formatting in your template sensor however.

You could also use a python_script

Testing the dev-phue version, setup failed until I created a blank file called services.yaml in the custom_components directory, but now all seems to be running fine
Cheers

Thanks for the heads up @jimbob1001. That is interesting as I do not have services.yaml as far as I can see. Is that file in your main config directory? Also how did you know to try adding this file?
Cheers

It was mentioned in a previous post here; prior to adding the services.yaml to the custom_components directory there is an error message in the log about the file being missing.

In custom_components/hue.py (not sensors/hue.py) there is a reference to it from line 213…

    descriptions = load_yaml_config_file(
        os.path.join(os.path.dirname(__file__), 'services.yaml'))
    self.hass.services.register(
        DOMAIN, SERVICE_HUE_SCENE, hue_activate_scene,
        descriptions.get(SERVICE_HUE_SCENE),
        schema=SCENE_SCHEMA)

Can also report that Motion sensor and hue tap are both responding instantaneously

Thats the hue hub component. Clearly will need to look into this further

Hi all, I’ve updated the custom component to be consistent with the hub component in HA 0.61 and above (phue-dev is merged into master and therefore no longer exists, also tested with 0.60 and 0.62 successfully). Please ensure you are up to date on both HA (0.61) and the component. Generally when submitting queries on these forums you should state which version of HA you are on to help debugging. I will however assume from now on that everyone is on 0.61 or above, unless otherwise stated.

Please submit any log errors on Github, unless clearly related to config in which case they belong here on the forums. Hopefully config of the component is so simple there will be none :slight_smile:

Next development is to split out remotes as remotes and have them fire events when buttons are pressed, rather than treating them as sensors. If anyone wants to help out (developing or beta testing) please get in touch.
Cheers

1 Like

HI @robmarkcole

i am slightly confused…:wink:
which file do i need to download and replace in my custom_compnents folder?

at the moment i have:

/custom_components/sensor/hue_sensor.py and hue_sensors.py

hue_sensors.py was your previous version.
You changed names to prevent confusion, or is it a third file we need? And, we still need the hue_sensor.py?

Thanks,
Marius

By default you only need what is in the Github repo.

ONLY If HA has problems installing dependencies, then you need to manually add them as per previous insurrections in this thread.
Cheers