Oh, I see.
So only the web interface port can currently be configured in HA.
What is that one used for?
The REST API (which the component uses to control/modify devices) is available over the web port, the websockets interface (which the component uses to get real-time updates re: device status) is on the ws port.
I’d prefer not to allow configuration of the web port either. But unfortunately when wifi is available on device deconz might tell hass the wrong port… (Early issue for a couple of users)
Well got it working using the ports option in docker-compose. Here is what I’m currently using in my docker-compose.yaml file:
deconz:
image: marthoc/deconz
container_name: deconz
network_mode: host
restart: always
ports:
- “8103:443”
- “8100:80”
volumes:
- /opt/deconz:/root/.local/share/dresden-elektronik/deCONZ
devices:
- /dev/ttyUSB0
environment:
- DECONZ_WEB_PORT=8100
- DECONZ_WS_PORT=8103
- DEBUG_INFO=1
- DEBUG_APS=0
- DEBUG_ZCL=0
- DEBUG_ZDP=0
- DEBUG_OTAU=0
Guys,
I bought one of those Xiaomi Smart Switch ( https://pt.gearbest.com/access-control/pp_626695.html?wid=1433363¤cy=EUR&vip=14577034&gclid=EAIaIQobChMIkZWki--H3AIVQWYbCh34CA7FEAQYAyABEgLo4fD_BwE), added it to Phoscon App as a Switch:
But it’s showing on Hassio only as Battery Sensor, not as Switch or Binary.
Any Help? Thanks
Check out the dimmer example in the deconz doc. The switch emit events when the button is pressed.
Just wondering if anyone seen any issues with DeCONZ after upgrading to 0.73?
I am getting the following after starting HASS:
2018-07-07 20:28:50 DEBUG (MainThread) [pydeconz.websocket] Websocket starting
2018-07-07 20:28:50 ERROR (MainThread) [pydeconz.websocket] Unexpected error None
2018-07-07 20:28:50 DEBUG (MainThread) [pydeconz.websocket] Websocket starting
2018-07-07 20:28:50 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.
Only way to get it working is downgrading to 0.72.1, very weird.
The websocket implementation has changed. Are you running deconz standalone or in a container?
Oh, ok, I am running standalone.
I couldn’t find anything about it, anything I can do?
Nevermind, just saw https://github.com/home-assistant/home-assistant/issues/15310
The simplest solution is to go over to using the deConz docker container. If you do that on the same machine you can keep your configuration so you shouldn’t really notice anything
Hello hello!
Just wondering if you guys have seen something like that. I got a circular Xiaomi switch and I it’s fine to add it on DeCONZ (even though it doesn’t show up on the WebUI), it does show up in the DB (a GET on the sensors show them up).
Only thing is that I can’t see them on my HA at all meaning that even though when I push the buttons, they show up on the HA logs as events, HA doesn’t do anything and I believe it’s because they haven’t been added as sensors.
I do have 2 Water Leak sensors and they do not show up on the WebApp on Deconz but they are fine with HA.
Any ideas on what could be happening? ( I could be missing something as well ).
Thanks!
Buttons like the Xiaomi switch you have are stateless sensors, so they will only be represented by events. There are examples in component documentation for how to write automations for them.
Yes, I have others like that and they do work as expected, it’s just these ones that I can see the event showing up running HA in debug (pydeconz) but nothing happens.
An example is like this:
- alias: Single Bedroom double click
trigger:
platform: event
event_type: deconz_event
event_data:
id: lumi.sensor_switch
event: 1004
action:
service: switch.toggle
entity_id: switch.kitchen_lamp
So I see a 1004 event something from deconz but HA doesn’t do anything.
Is that the proper id? If hass isn’t doing anything then it might be the wrong id
Yes, it’s the correct id:
2018-07-20 12:10:29 DEBUG (MainThread) [pydeconz.deconzdevice] lumi.sensor_switch: update buttonevent with 1004
2018-07-20 12:10:29 DEBUG (MainThread) [pydeconz.deconzdevice] lumi.sensor_switch: update lastupdated with 2018-07-20T11:10:29
2018-07-20 12:10:29 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {"e":"changed","id":"4","r":"sensors","state":{"buttonevent":1004,"lastupdated":"2018-07-20T11:10:29"},"t":"event"}
It’s just weird as it works just fine with the other switches, the only difference is that this one is the round one and my others are square.
So if I understand this correctly, deconz sends the events to pydeconz who updates the state, but no event inside Hass is visible in the logs or sent ?
That’s the thing, this is the full log with debug:
2018-07-20 14:27:55 DEBUG (MainThread) [pydeconz.deconzdevice] lumi.sensor_switch: update buttonevent with 1004
2018-07-20 14:27:55 DEBUG (MainThread) [pydeconz.deconzdevice] lumi.sensor_switch: update lastupdated with 2018-07-20T13:27:55
2018-07-20 14:27:55 INFO (MainThread) [homeassistant.core] Bus:Handling <Event deconz_event[R]: id=lumisensor_switch, event=1004>
2018-07-20 14:27:55 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {"e":"changed","id":"4","r":"sensors","state":{"buttonevent":1004,"lastupdated":"2018-07-20T13:27:55"},"t":"event"}
Shouldn’t I have this lumi.sensor_switch also on HA states (HA-host/dev-state)?
It’s not there at all, even though it shows up when HA starts (listing every sensor):
'4': {'config': {'battery': None,
'on': True,
'reachable': True,
'temperature': None},
'ep': 1,
'etag': '13b0bcd0024ad90548fa3c6124118b84',
'manufacturername': 'LUMI',
'mode': 1,
'modelid': 'lumi.sensor_switch',
'name': 'lumi.sensor_switch',
'state': {'buttonevent': 1004,
'lastupdated': '2018-07-20T13:25:01'},
'type': 'ZHASwitch',
'uniqueid': '00:15:8d:00:02:24:49:cc-01-0006'},
The error is as suspected. You have written lumi.sensor_switch, whereas the I’d is lumisensor_switch
At the moment hass doesn’t list this kind of event in the gui yet
Hi Robban,
Thanks for that but where did you see it’s lumisensor_switch? The id coming from DeCONZ is lumi.sensor_switch.
For the sake of it, I tested with lumisensor_switch and it also didn’t work
Edit: I stand corrected, just switched the lumisensor_switch and it worked but the question is. How come it’s lumisensor if the id coming is lumi.sensor? I haven’t noticed that before but the water leak sensor has also lumisensor (altogether).
The id is slugified version of the deconz name. Since events has a limited amount of characters supported.
I will make sure to update the documentation to be clearer about this.
It can be read in the event itself 2018-07-20 14:27:55 INFO (MainThread) [homeassistant.core] Bus:Handling <Event deconz_event[R]: id=lumisensor_switch, event=1004>