ConBee ZigBee Stick and HA, will this work together?

Adding a bug-report here:

I have merged this pull request with my current installation of 0.60 and have gotten the deCONZ integration running just fine.

Except for one type of sensor I have; the Aqara Temperature/Humidity sensor.

When this is added to HA from deCONZ it is added as three sensors. One for temperature, one for humidity and one for airpressure.

They are added as sensor.[name in deconz], sensor.[name in deconz]_2 and sensor.[name in deconz]_3

The problem is that this order is seeminly random. After restarting HA, the sensor that previously was temperature might be the humidity or airpressure sensor.

Attaching two screenshots to illustrate. The first image is before restarting HA, the second one is after restarting.

sensor1a

And after restarting HA

<Image with the names reshuffled which I can’t attach as a new user…>

This is only one sensor in deCONZ, and I have not found a way to rename the three individual sub-sensors, only the whole “package”

Here is the second image
sensor1b

See this comment ConBee ZigBee Stick and HA, will this work together?

As a reply to: https://github.com/home-assistant/home-assistant/pull/10321#issuecomment-355237224

You can rename sensors using the Phoscon app.
However, in Phoscon, you will only have 1 sensor representing the lot (for Xiaomi stuff anyway).
So all three (Temp,Humid,Pressure) are named the same.

You should rename the sensors accordingly, if you want to use the new Deconz plugin written by @Robban
This is done vi the API, with a PUT to the sensor in question, and a json containing the new name, i.e.:
GET http://{{ip}}/api/{{username}}/sensors (to get ALL sensors and determine the correct id for i.e. the Humidity Sensor)
Then you do a put:
PUT http://{{ip}}/api/{{username}}/sensors/19 <----- ID of the sensor !!!
Body Json:
{
“name”: “bathroom_humidity”
}

Hope this helps some!

3 Likes

This does indeed help :slight_smile:

Edit: Yep, worked fine, but an interface in Phoscon would definitely be preferable to manually sending JSON-queries :slight_smile:

1 Like

Created an issue for the Phoscon app to add support for this https://github.com/dresden-elektronik/phoscon-app-beta/issues/4

@Robban did you ever consider, making the default component_id’s the uniqueid instead.
I am asking, since even if you mess-up your deCONZ database, you would still be able to re-discover everything inside Home Assistant without a big hassle.

Perhaps, if no friendly-name was set yet, via customization, you could set this by using the deconz name param.

Just a thought.

What is the default component id? Do you mean the unique id? Does it differ between sensors on a multi sensor device?

I was thinking about auto adding a suffix when none are available on sensors, but I prefer not to meddle with stuff that can be changed by the user.

@Robban congrats on the PR merge!
Do you know if your Deconz component will work with hassio? I’ve googled plenty but can’t find a clear answer if Conbee and Deconz can be installed on a hassio setup at all.

1 Like

@Robban, sorry, the entity id inside HA.
The uniqueid is different for all sensors, also for the three sensors in one case, i.e.:
{ "17": { "config": { "on": true, "reachable": true }, "ep": 1, "etag": "b61545be155759f8150333ed15f1e932", "manufacturername": "LUMI", "modelid": "lumi.weather", "name": "bathroom_temperature", "state": { "lastupdated": "2018-01-04T11:08:38", "temperature": 1972 }, "type": "ZHATemperature", "uniqueid": "00:15:8d:00:01:ab:4b:0e-01-0402" }, "18": { "config": { "on": true, "reachable": true }, "ep": 1, "etag": "b61545be155759f8150333ed15f1e932", "manufacturername": "LUMI", "modelid": "lumi.weather", "name": "bathroom_humidity", "state": { "humidity": 4909, "lastupdated": "2018-01-04T11:08:38" }, "type": "ZHAHumidity", "uniqueid": "00:15:8d:00:01:ab:4b:0e-01-0405" }, "19": { "config": { "on": true, "reachable": true }, "ep": 1, "etag": "b61545be155759f8150333ed15f1e932", "manufacturername": "LUMI", "modelid": "lumi.weather", "name": "bathroom_pressure", "state": { "lastupdated": "2018-01-04T11:08:38", "pressure": 991 }, "type": "ZHAPressure", "uniqueid": "00:15:8d:00:01:ab:4b:0e-01-0403" } }

Using it as the entity id inside HA, the entities would become the same object again, even if your deCONZ database was fried.
The names however, become the default ones again after you would rebuild your DB.

I already started working on this as a custom component, but you finished it before I did :slight_smile:
Anyway, it was my initial thought, to ensure that even a complete new deCONZ implementation, would simply get the same customizations again, as you would have applied them based on the entity_id = hardware’s uniqueid.

Thanks!

@marthocoo is working on proper docker support for deconz. Unfortunately it is not as clear cut as creating an image due to the way that deconz communicate with the hardware.

It’s a good suggestion .The biggest issue with it is readability when using the lights in any way inside of hass.

Hi,

I have read most of the above and it looks like great progress. I’m just starting out in the HA world and have ordered myself :

  • Raspberry Pi 3
  • Raspbee
  • Ikea Light and Switch
  • Some Sonoff touch switches and Relays (I’ll be flashing these with the MQTT firmware)
  • A Mi Temp sensor.

I just wanted to check the current state of things with regard to deCONZ etc, it looks like the PR above has been accepted, but not sure when that rolls into the production release of HA. Specifically my questions are :

  1. Should I be installing HASS.IO or do I need a standard Rasbian install to get deCONZ up and running? I’m not sure if you can install extra stuff on a HASS.IO box or if its just changes to the docker container you can’t do without it upgrading itself.

  2. Once I have installed deCONZ, can I add my devices (IKEA and MI) when its in headless mode, or will I have to have a X environment to do the initial setup? I see there is a beta web interface, Phoscon, as part of the deCONZ platform, but I wasn’t sure if that can be used to configure the network.

If there are any how to guides that cover the above I’ll happily go away and read them if you can link me to one.

Regards

Ben

1 Like

Welcome to the beautiful world of home automation. :slight_smile:

  1. Right now the separate deconz instance doesn’t work in docker and because of that in hass.io. @marthocoo is working on getting deconz to work in docker together with Dresden Elektroniks. If you have a second computer running you can have it running there instead. I don’t know if you can install deconz in the base operating system outside of docker, might be worth looking in to.
  2. Even when running in headless mode deconz still have a web Gui, there is also a newer separate Gui that is in beta, Phoscon it is called. The component exposes the full rest api of deconz though, which means you can reach all settings and functionality of deconz directly through the deconz service in hass.

I think most is covered in the component documentation, if it is not, maybe I should improve it. You can find the raw documentation here since it won’t be available on the home page until 0.61 has been released.

https://github.com/home-assistant/home-assistant.github.io/blob/next/source/_components/binary_sensor.deconz.markdown
https://github.com/home-assistant/home-assistant.github.io/blob/next/source/_components/deconz.markdown
https://github.com/home-assistant/home-assistant.github.io/blob/next/source/_components/light.deconz.markdown
https://github.com/home-assistant/home-assistant.github.io/blob/next/source/_components/scene.deconz.markdown
https://github.com/home-assistant/home-assistant.github.io/blob/next/source/_components/sensor.deconz.markdown

Hey @Robban, congrats on getting the PR merged!

To the first question, there’s currently no way to get the deCONZ server software working on the same machine as Hass.io, this requires first deCONZ to be working in Docker which I am working on and hoping to get some support for from DE soon.

You can however have deCONZ running on an install of Raspbian natively and also have Home Assistant running on the same RPi either in a python virtual environment or under Docker (this is how I’m currently running it while I work on a Docker container for deCONZ).

To the second question, you don’t need an X session running to get lights sensors, etc working in deCONZ. I’ve been able to use both the original web app and the Phoscon web app in combination to do everything I’ve wanted to do (including adding new devices, changing names, making groups, and so on). DeCONZ now comes with a systemd startup script that you can enable to run the server in headless mode.

I suspect we may not see a release of 0.61 until next weekend but I have created a Docker image of Home Assistant that includes a slightly earlier version of @Robban’s component on top of 0.60 that I’ve been using in the meanwhile that you can read about at https://github.com/marthoc/home-assistant-deconz and use on the RPi if you want to get up and running and setting your devices up before 0.61 drops.

Any other questions @Ben.S just let me know.

1 Like

Great that seems like the way to do it. Looks like you still get all the hass.io advantages of guy updates etc, but on a system you can run other things on at the same time (like deCONZ and specific daemons like one for a UPS etc). Do that’s the route I shall take.

I shall read the docs on your site and the ones @Robban linked me to. I’m pretty sure I shall have some questions in this process :wink: but I’ll try to keep them sensible!

I see 0.60.1 is released, so I guess your right that we won’t get 0.61 till next weekend now.

Ben

This chart helped me alot ty for that.
Could you also post the code in the switches to identify which one is triggered?
hope you see that :smile:

Hey @Robban and others, congrads with all the progress you made in such short time. I have a raspbee since October last year, but haven’t got the time (or skills) to add it to home assistant. Will definitely be using this component to throw out the Xiaomi hub (and its connection to the Chinese servers)

One question: is there also a possibility to include the double click event of the Xiaomi wireless button? I’m using this a lot for my buttons.

Thanks!

1 Like

All different button clicks will be exposed to home assistant

I get this errors in my setup, I have tried reinstalling everything and stil get the same. Where can I continue my search?

2018-01-09 22:50:26 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform deconz
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 171, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File “/usr/lib/python3.5/asyncio/tasks.py”, line 400, in wait_for
return fut.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/asyncio/tasks.py”, line 239, in _step
result = coro.send(None)
File “/usr/lib/python3.5/asyncio/coroutines.py”, line 210, in coro
res = func(*args, **kw)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/deconz.py”, line 29, in async_setup_platform
if sensor.type in DECONZ_BINARY_SENSOR:
AttributeError: ‘NoneType’ object has no attribute ‘type’