New custom component : ZiGate (obsolete)

Update:

I added firing an event by adapting in sensors.py (I added a reference to self._hass = hass in the constructor):

    def update_attributes(self, property_id, property_data):
        self._attributes[property_id] = property_data
        self.schedule_update_ha_state()
        if property_id == self._default_attr:
            if self.entity_id is not None:
                self._hass.bus.fire('zigate', {
                    'entity_id': self.entity_id,
                    'state': property_data
                })

This seems to work as expected.
So then I can use again. This seems to work more reliable that tracking the state change.

automation:
- id: light_trigger_hallway_light_upstairs
  alias: Light Trigger Hallway Light Upstairs
  initial_state: true
  trigger:
    event_data:
      entity_id: sensor.hallway_upstairs_switch_left
      state: on-press
    platform: event
    event_type: zigate
  action:
  - data:
      entity_id: light.hallway_light_level
    service: homeassistant.toggle

Illuminance seems not working for me :frowning:

  • platform: zigate
    name: ‘illuminance 2’
    address: b4b501
    default_state: ‘illuminance’
    default_unit: ‘lx’

I already add the motion sensor as a switch (in order to control yeeligh):

  • platform: zigate
    name: ‘sensor2’
    address: b4b501
    default_state: ‘event’
    type: ‘momentary’

Is it possible to declare the same product as switch and sensor ?
Thanks :slight_smile:

EDIT : i retrieve battery states on the switch and the sensor :
switch :
last seen: 2018-03-12 09:17:19
battery: 3.015
friendly_name: sensor1
event: presence detected

sensor :
last seen: 2018-03-12 03:57:32
battery: 3.015
unit_of_measurement: lx
friendly_name: illumination 1

EDIT 2 : Still no illuminance.
i redownloaded HEAD of plugging, pyzigate, restart, nothing working :frowning:

Hi,

Don’t know if this should be considered off topic or not, but does anyone know how to get the multiple values in a single history graph? For example, my Xiaomi temperature sensor reports temperature, humidity and battery status…

But the history graph only displays one. I’m fairly new to HA and looked around the docs but couldn’t really find anything on this.

I suppose you’ll get them displayed separately. As 3 badges or 3 entry in the interface.And depending on which value you click you’ll see one or the other graph.

It’s possible to display several graph in one, but it’s not a default behaviour.

And that’s exactly what my question was… How do I do that? All three values belong to the same sensor.

When I click the sensor, I get the history graph with one value (temperature) and underneath it the current values for all three items.

Hiw do I get it to display all three values in the history graph?

Then yes, it’s off topic ^^

But here you go, you can achieve that with grafana (not really simple though):

I’m using influxDB and grafana, if someone need help i may help :slight_smile:

EDIT : after reinstalling evrything, still no illuminance. I continue to investigate :slight_smile:

EDIT 2 :
In my pyzigate folder ( 0.1.3.post1) i have illuminance information :

interface.py:            b'0400': 'Measurement: Illuminance',
zgt_parameters.py:ZGT_ILLUMINANCE_MEASUREMENT = 'illuminance'
attributes_helpers.py:        # Illuminance Measurement
attributes_helpers.py:                illuminance = int.from_bytes(attribute_data, 'big', signed=True)
attributes_helpers.py:                self.set_device_property(device_addr, endpoint, ZGT_ILLUMINANCE_MEASUREMENT, illuminance)

In my custom_component I use the good zigate library :

__init__.py:REQUIREMENTS = ['pyserial-asyncio==0.4', 'pyzigate==0.1.3.post1']

In my log i have information ( cf previous post )
In my switch.yaml ::

- platform: zigate
  name: 'sensor2'
  address: b4b501
  default_state: 'event'
  type: 'momentary' 

In the Web interface, no illuminance information :

switch.sensor2	off	last seen: 2018-03-12 15:35:52
                    event: presence detected
                    friendly_name: sensor2 

EDIT 3 :
I tried to remove the switch declaration in order to add it as a sensor : same issues …

Any idea ? :slight_smile:

Just to be sure, which motion sensor are you using? The older one does not provide illumination information… Which Zigate firmware do you have installed on your stick?

Hello
I’m using the last firmware 0d.
In home assistant, the motion detector is detected as “aq2” .

The brand “aquara” is written on the top of the detector.
According Gearbest it’s “V2”.

Hi guys,

I have a problem. I’m trying to setup the zigate component by unzipping the files into custom_components under hassio/config/. After this, I add this to my configuration file:
#Enable ZiGate
zigate:

So far so good, but when I do the configuration validation it comes back with the following result:
Configuration invalid
Testing configuration at /config
Failed config
zigate:
- Invalid config for [zigate]: string value is None for dictionary value @ data[‘zigate’][‘host’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/zigate/
- cloud: ?
mode: production
config: ?
conversation: ?
discovery: ?
ignore: ?
frontend: ?
javascript_version: auto
group: ?
history: ?
exclude: ?
include: ?
use_include_order: False
http: [source /config/configuration.yaml:23]
api_password: mysecretpassword
base_url: https://mydomain.duckdns.org:8123
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
logbook: ?
map: ?
script: ?
sun: ?
updater: ?
zigate: ?

Successful config (partial)
zigate:

What is going on and how can I solve this?? Thanks in advance!

Hi guys! I have successfully paired Ikea Tradfri bulbs with ZiGate. However, whenever I try to turn off different groups of lights at the same time with automation script/google assistant, not all lights are switched off as expected. Some of them stay on, despite the fact that home assistant show’s status “off”. Can you help me out?

Hmmm could it be that the range is limited by interference or something like that? The channels overlap somewhat with WiFi I believe. Also, I’m wondering if the Ikea bulbs act as repeaters or not.

I have Hue lights throughout the house that act as repeaters for at least each other. I also have Xiaomi stuff that’s working fine through two layers of concrete. I don’t think the Xiaomi stuff is repeated by the Hue bulbs though.

The distance shouldn’t be an issue as all of my lights are pretty close to ZiGate… Is there anything I could do about lights interference with WiFi?
Also, I have an automation in which wardrobe lights must be switched off, when no motion is detected. I noticed that 1 particular light was always on, after automation to switch off closet lights was activated. So I added 1 additional line for this particular bulb and now it’s working just fine. However, I don’t think it’s right way to solve such issue :slight_smile:

  action:
    - service: homeassistant.turn_off
      entity_id: group.closetlights
    - service: homeassistant.turn_off
      entity_id: light.wardrobe1_3

btw, i updated the githup to follow my issue :slight_smile:

Probably not a lot. If I remember correctly it’s a partial overlap with some channels in the 2.4ghz range. You could try to use your router’s interface to scan for overlaps if that’s supported.

Hmm… are you sure you added the light to your closet group? No typos? :slight_smile:

@mvdkleijn regarding the problem with my closet lights group. I have double checked my automations and I can confirm that there are no typos in closet group. I can control all the lights with no problems trough the web portal. From my personal observations I noticed that I am having issues with automation, when I am trying to switch off the group of lights. I am not facing any issues with automation when I write the code to switch of every single light separately, instead of switching the whole group. What could cause such weird issue?

Indeed it sounds weird. Unfortunately I don’t have any IKEA lights so I don’t know much about them.

Since switching it off one by one works, we can reasonably state the bulb itself is fine.

I’m fairly new to HA myself though… The problem must be in HA or the Zigate component I guess. I’m assuming you don’t have a lot of lights in your closet so some sort of limit being hit would probably not be it.

How many devices do you have connected to Zigate in total?

Did someone already used the Ikea TRÅDFRI dimmer (the small rotary one).

I successfully got a device announce but I don’t get any data in log when turning the dimmer (in debug mode).

If someone remember how to pair it and could post an example configuration, it would help me :slight_smile:

Edit: It’s this dimmer:

have you read http://faire-ca-soi-meme.fr/domotique/2018/03/14/une-telecommande-zigbee-pour-les-controler-tous/
it probably works the same way.

1 Like

Arf, didn’t see this article, had I known that before I wouldn’t have ordered a Zigate…
The main reason was to be able to use those button and dimmer to execute action in hass, which seems impossible as long as the ZiGate cannot be seen as a device.

Thanks for the link.