rave
(Rave Tam)
January 14, 2017, 10:38am
371
i think after separating the platform code from the component itself, it will be quite complex to fix bugs in the platform code. Right now, i just have to update the py files and i’m done.
I think i’ll go down that road once multi gateway code is completed (code is done, testing right now)
1 Like
I disabled your component, and put fooxy componet. Now everything works on my installation (now at least). Have no idea what is wrong with yours, but was working intermittently
So maybe is not such a bad idea to include your code in the general picture
rave
(Rave Tam)
January 14, 2017, 11:52am
373
Does anyone knows how RGB light works in HA? I have added the gateway as a light but i don’t see any option to change the color or brightness in HA.
garvarma
(Manuel)
January 14, 2017, 11:56am
374
Hi @anon35356645 ,
No not for all xiaomi, only for door sensor and motion sensor.
I’m waiting to receive morre sensors like motion and door, and also switch button. Once when i will have all (hope soon), then i will try to use @rave code.
Best regards,
garvarma
(Manuel)
January 14, 2017, 12:11pm
375
Hi @maud ,
As @Danielhiversen says, i used the customizing devices and services.
To use it, these are the lines codes that you need to add:
In configuration.yaml just, after time zone add this line:
time_zone: Europe/Madrid
customize: !include customize.yaml
In customize.yaml file that you must create i have this:
binary_sensor.door_entrada:
** icon: mdi:glassdoor**
** friendly_name: Sensor_Puerta_Ent**
binary_sensor.move_comedor:
** icon: mdi:walk**
** friendly_name: Sensor_Mov_Comedor**
Also i have defined a binary_sensor file:
- platform: template
** sensors:**
** door_entrada:**
** friendly_name: Frontdoor**
** value_template: “{{ states.sensor.magnet_158d00010104ab.state == ‘open’ }}”**
** sensor_class: opening**
** entity_id:**
** - sensor.magnet_158d00010104ab**
- platform: template
** sensors:**
** move_comedor:**
** friendly_name: SensorComedor**
** value_template: “{{ states.sensor.motion_158d00012934e6.state == ‘motion’ }}”**
** sensor_class: opening**
** entity_id:**
** - sensor.motion_158d00012934e6**
And at the end, I have a file to manage groups in the main page of HA:
Alarma:
** entities:**
** - binary_sensor.door_entrada**
** - binary_sensor.move_comedor**
garvarma
(Manuel)
January 14, 2017, 12:16pm
376
Hi @rave ,
Do you refer for example xiaomi RGB light bulb?
Here you have a python code that works with xioami light bulbs:
https://community.home-assistant.io/t/xiaomi-yeelight-e27-bulb-component/695/168
In HA, when you switch on light, and then click on the icon, appears this windows, where you can choose color:
1 Like
rave
(Rave Tam)
January 14, 2017, 12:18pm
377
thanks but i still can’t find how a color can be changed from HA user interface.
Edit: just saw your screenshot, thanks! that helps
rave
(Rave Tam)
January 14, 2017, 12:22pm
378
major update coming soon in a few hours. Multi hub support, motion sensor status update in 1min and gateway light support
3 Likes
@rave you can also do this from config:
scene:
- name: Morning First Motion
entities:
light.livingroom:
state: on
brightness: 100
rgb_color: [205,160,90]
color_temp: 500
light.keuken:
state: on
brightness: 100
rgb_color: [205,160,90]
color_temp: 500
3 Likes
If you like I can help do some pre-testing/bug fixing?
rave
(Rave Tam)
January 14, 2017, 12:25pm
381
thanks! great info as always
rave
(Rave Tam)
January 14, 2017, 12:27pm
382
that would be great. i’ll create a branch later after i get my dinner have been coding for almost half a day
1 Like
hangy
(Angelo La Mazza)
January 14, 2017, 12:52pm
383
I’m also here for testing… I’ve 22 xiaomi sensors online
rave
(Rave Tam)
January 14, 2017, 1:43pm
384
Update posted. Read the first post for details
Cool @rave thanks for all your work!
Having trouble with the new interface feature, it detects my setting but the binding still fails as before.
Had this patched manually before but didn’t save the change.
Before the gateway wasn’t discovered without the patch, that’s working fine now.
But a few moments later it fails at this line 134 with the same exception:
sock.bind((self.MULTICAST_ADDRESS, self.MULTICAST_PORT))
Maybe this needs the interface parameter too?
rave
(Rave Tam)
January 14, 2017, 2:59pm
386
I have not tried that. The code was from @kirichkov
I think you’re right. Try replacing self.MULTICAST_ADDRESS with the IP and see if it works
hangy
(Angelo La Mazza)
January 14, 2017, 3:20pm
387
For me it’s ok… All sensors detected
Yep changed to
sock.bind((self._interface, self.MULTICAST_PORT))
That works! Testing the rest tonight!
rave
(Rave Tam)
January 14, 2017, 3:29pm
389
Just added RGB + brightness Gateway Light support also fix some bug related to performance.
2 Likes
rave
(Rave Tam)
January 14, 2017, 3:29pm
390
Great. If there’s no issue then i’ll update the code and do a final commit
if self._interface != 'any':
sock.bind((self._interface, self.MULTICAST_PORT))
mreq = socket.inet_aton(self.MULTICAST_ADDRESS) + socket.inet_aton(self._interface)
else:
sock.bind((self.MULTICAST_ADDRESS, self.MULTICAST_PORT))
mreq = struct.pack("4sl", socket.inet_aton(self.MULTICAST_ADDRESS), socket.INADDR_ANY)