Hue motion sensors + remotes: custom component

Sorry could you clarify your question? Cheers

How obscure of me. I thought you knew what I was thinking.:slight_smile:
I used your latest dev version to get myself working again after the hue_sensor.py didn’t seem to load. The dev version follows the earlier version with a hue.py in custom_components and one in sensors while the Hue_sensor.py is a singular file in sensors. So should I go back and figure out why the hue_sensor.py version didn’t work or should I just keep using the dev version. If all future work will go into providing the component as hue_sensor.py then I should try to get it working???

awesome stuff, but I am having trouble following your install guide (I’m new to HA), I have so many questions:

If I understood correctly, I just have to create a new directory (/custom_components/sensor/) and paste the hue_sensor.py into it, right? No need to change anything within that file?

Note that in some cases phue.conf may be named differently, for example mine was something like phue-12412523.conf so I copied and pasted this file, then renamed to phue.conf.

what?? :smile: So I just have to rename my phue-12412523.conf to phue.conf? But I have to copy paste it beforehand? If so, where do I paste it?

To add the following group to your HA frontend, add the following to groups.yaml (obviously editing to use your sensors):

How do I add my motion sensors name, if I don’t see it in homeassistant yet? how do I find out its name?

Do I have to add my hue lights into this file as well? Becuase HA already discoverd them and they’re working fine. I just need the motion sensor, don’t care in which group its in.

Please stick with the working dev version, this is getting close to submission as a component and there will be changes under the hood but no breaking changes.
Cheers

Many many thanks for your efforts.

1 Like

HI,

Please let me get back on this automation… it doesn’t work as expected…
I’ve renamed a sensor and changed the rest sensors accordingly. They show fine.

The sensors created through your customcompnent though don’t update, and still show with their old name. Of course that is incorrect (i have no idea why they show up, and where, they are created…), so they show ‘-’.
Ive deleted the cache already, and even have the philips hue be discovered again (had Hue excluded from discovery).

What should i try t get them back in order again please ?

Old and incorrect ones:

33

Should be here (compare with my posting above):

20

And the rest sensors created manually:

As you can see i moved the sensor from the auditorium to the corridor;-)

Hope you have a clue, and suggestion,

Marius

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