Xiaomi Gateway Integration

Maybe so.
I also noticed the Aqara and Eigenstone - who both seem to be other companies involved in the design/manufacture of these devices - both have apps available on the Apple appstore.
Both apps seem to be the same (but with different graphic assets) but neither will work as I cannot register with a UK cellphone - reg text never gets sent. Maybe a Chinese number would work, but I cant get one.

I have the new temp sensor and door sensor on the way.
Didn’t like the new switch design (button in the middle of the enclosure) compared to the old one.

where did you get these new sensors? I couldn’t find them in gear best or aliexpress!

they’re right there http://www.gearbest.com/aqara-_gear/

1 Like

Following on with my xiaomi and HA integration journey, I managed to hack the Xiaomi ip camera thanks to this project!!!
Also got it working with HA via rstp.

Still no luck with the wifi plug.

5 Likes

Good info about the XiaoFang WiFi Cameras.
You should post it in a separate/new thread.

Yep, will do in the Share your projects topic.

I have the exact same code… But my Gateway doesn’t use my rgb_colors…

- id: nachtlicht
  alias: "Nachtlicht bei Bewegung"
  condition: 
    - condition: state
      entity_id: sun.sun
      state: 'below_horizon'
  trigger:
    - platform: state
      entity_id: binary_sensor.motion_sensor_158d00010f859c
      from: 'off'
      to: 'on'
  action:
    service: homeassistant.turn_on
    entity_id: light.gateway_light_f0b429cc315f
    data:
      rgb_color: [255,197,121]
      brightness: 75

In my code the entity id is inside the data section

Thanks. I tried but it doesn’t affect the Gateway’s color.

I use this for random color:

action:
  - service: light.turn_on
    entity_id: light.gateway_light_f0b429cc6f0b
    data_template:
      brightness: 60
      rgb_color: ['{{ (range(0, 255)|random) }}','{{ (range(0, 255)|random) }}','{{ (range(0, 255)|random) }}']
2 Likes

you can use

color_name: white

instead of an rgb code

2 Likes

Color_name works! Is there a possibility to find out which range of colors is possible to name?

CSS3 color names are supported https://www.w3.org/TR/2010/PR-css3-color-20101028/#svg-color

1 Like

cool, but is it better then effect: random?

Thanks. I tried the following colors: red, green, blue, goldenrod, chocolate and yellow. It only worked with red, green and blue - i.e. the three standard RGB-colors. All the other colors end up as white. Has anyone tried to apply Flux Light Adjustment to the Gateway Light? If working this could result in an “eye-friendly” night light.

You use service: homeassistant.turn_on. Maybe this is a reason why you have problems with color. Try service: light.turn_on.

Effect random isn’t working form me.

I just want to give some feedback. After the new 1.4.1_146.0141 the door/window sensors are no longer stuck in the “open” state after a power cut. PIR sensors, however, still show motion after a power cut.

There were some questions about using cube to adjust brightness but there was never a complete code posted, after some trial and error i got mine working with my yeelights so here it is:

- id: rotate_cube_brightness
  alias: Set brightness by rotating cube
  trigger:
    platform: event
    event_type: cube_action
    event_data:
      entity_id: binary_sensor.cube_158d00011xxxxx
      action_type: rotate
  action:
    service: light.turn_on
    data_template:
      entity_id: group.kitchen_lights
      brightness: >
                    {% set state = states.light.yeelight_white_1.attributes.brightness|int + ((trigger.event.data.action_value|float)*1.25)|int -%}
                    {%-  if state > 255 -%}
                       {%- set state  = 255 -%}
                    {%-  elif state < 0 -%}
                       {%- set state  = 0 -%}
                    {%- endif %}
                    {{ state }}

i put in the 1.25 multiplier so I don’t have to rotate the cube a lot to get from 0 to 100 brightness since it increased the brightness by the amount it rotates in the first iteration of the code and i found it to be a bit cumbersome so i sped it up by 25%

3 Likes