Xiaomi Smart Home Suite (very cheap) compatibilty?

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

arkoko
Posts: 34
Joined: Saturday 17 December 2016 12:13
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Estonia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by arkoko »

corbin wrote:It might be another program listening on UDP. I will try to stop the crash in my code. Are you running other programs or plugins that could be conflicting?
I had same error when HomeAssistant ran in the background. After stoping and disabling this service no more errors.
User avatar
vetalok
Posts: 22
Joined: Friday 30 December 2016 12:40
Target OS: Linux
Domoticz version: 3.6273
Location: Lviv, Ukraine
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by vetalok »

corbin wrote:
vetalok wrote:
Yes. System crashed and not restarted.
Only If I delete a domoticz.db file, the system runs.
What am I doing wrong? Why do I have this issue?
It might be another program listening on UDP. I will try to stop the crash in my code. Are you running other programs or plugins that could be conflicting?
No, my netstat:

Code: Select all

tcp        0      0 127.0.0.1:5037          0.0.0.0:*               LISTEN      12020/adb       
tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      16440/java      
tcp        0      0 127.0.0.1:30000         0.0.0.0:*               LISTEN      23787/bash      
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:5940          0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      16440/java      
tcp        0      0 0.0.0.0:24800           0.0.0.0:*               LISTEN      24429/synergys  
tcp        0      0 0.0.0.0:40801           0.0.0.0:*               LISTEN      7489/skype      
tcp        0      0 0.0.0.0:8999            0.0.0.0:*               LISTEN      7783/qbittorrent
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:42572           0.0.0.0:*               LISTEN      24414/synergy   
tcp6       0      0 :::80                   :::*                    LISTEN      -               
tcp6       0      0 :::1714                 :::*                    LISTEN      4776/kdeconnectd
tcp6       0      0 :::22                   :::*                    LISTEN      -               
tcp6       0      0 ::1:631                 :::*                    LISTEN      -               
tcp6       0      0 :::445                  :::*                    LISTEN      -               
tcp6       0      0 :::8999                 :::*                    LISTEN      7783/qbittorrent
tcp6       0      0 :::139                  :::*                    LISTEN      -  
My network:
Image


What is necessary to enter in the address and port fields?
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by corbin »

arkoko wrote:I had same error when HomeAssistant ran in the background. After stoping and disabling this service no more errors.
I've changed my code at https://github.com/corbinmunce/domoticz to set the "reuse_address" option before sending the device discovery message, which may fix this problem. Could you test please?
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by corbin »

vetalok wrote: What is necessary to enter in the address and port fields?
Thanks, it doesn't look like there is anything listening on UDP. What command did you use for netstat?

Address needs to be the IP address of your gateway, the port can be anything, 9898 is a good number to use.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
arkoko
Posts: 34
Joined: Saturday 17 December 2016 12:13
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Estonia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by arkoko »

corbin wrote:Could you test please?
Not anymore. After your last beautiful additions (temp & hum sensor, switch control) I uninstalled HomeAssistant from my pi :)
User avatar
vetalok
Posts: 22
Joined: Friday 30 December 2016 12:40
Target OS: Linux
Domoticz version: 3.6273
Location: Lviv, Ukraine
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by vetalok »

corbin wrote:
arkoko wrote:I had same error when HomeAssistant ran in the background. After stoping and disabling this service no more errors.
I've changed my code at https://github.com/corbinmunce/domoticz to set the "reuse_address" option before sending the device discovery message, which may fix this problem. Could you test please?
OK, building...
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by corbin »

arkoko wrote: Not anymore. After your last beautiful additions (temp & hum sensor, switch control) I uninstalled HomeAssistant from my pi :)
Awesome! :)
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by corbin »

vetalok wrote: OK, building...
Thank you! I hope to get it working for you.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
User avatar
vetalok
Posts: 22
Joined: Friday 30 December 2016 12:40
Target OS: Linux
Domoticz version: 3.6273
Location: Lviv, Ukraine
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by vetalok »

corbin wrote:
vetalok wrote: OK, building...
Thank you! I hope to get it working for you.
Oh.. =(((

Code: Select all

2016-12-31 11:33:49.388  Domoticz V3.6253 (c)2012-2016 GizMoCuz
2016-12-31 11:33:49.388  Build Hash: 928fcd1, Date: 2016-12-31 11:06:24
2016-12-31 11:33:49.389  Startup Path: /home/vetal/domoticzv3/domoticz/
2016-12-31 11:33:49.494  PluginSystem: Started, Python version '3.5.2'.
2016-12-31 11:33:49.497  Active notification Subsystems: http (1/12)
2016-12-31 11:33:49.497  WebServer(HTTP) started on address: :: with port 8080
2016-12-31 11:33:49.499  WebServer(SSL) started on address: :: with port 443
2016-12-31 11:33:49.500  Proxymanager started.
2016-12-31 11:33:49.500  Starting shared server on: :::6144
2016-12-31 11:33:49.500  TCPServer: shared server started...
2016-12-31 11:33:49.501  RxQueue: queue worker started...
2016-12-31 11:33:51.502  EventSystem: reset all events...
2016-12-31 11:33:51.502  EventSystem: reset all device statuses...
2016-12-31 11:33:51.502  EventSystem: Started
2016-12-31 11:33:51.954  PluginSystem: Entering work loop.
2016-12-31 11:33:56.563  Incoming connection from: 127.0.0.1
2016-12-31 11:35:10.369  XiaomiGateway: Worker started...
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
  what():  bind: Address already in use
arkoko
Posts: 34
Joined: Saturday 17 December 2016 12:13
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Estonia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by arkoko »

Did you try 'netstat -aun' to figure out used UDP ports?
User avatar
vetalok
Posts: 22
Joined: Friday 30 December 2016 12:40
Target OS: Linux
Domoticz version: 3.6273
Location: Lviv, Ukraine
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by vetalok »

Hah... problem fixed when I changed port on line

XiaomiGateway.cpp:

Code: Select all

XiaomiGateway::xiaomi_udp_server::xiaomi_udp_server(boost::asio::io_service& io_service, int m_HwdID, XiaomiGateway *parent)
	: socket_(io_service, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 9898))
9898 to 9899
arkoko
Posts: 34
Joined: Saturday 17 December 2016 12:13
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Estonia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by arkoko »

It means that something using 9898 port.
netstat -tulpn part from my pi:
udp 0 0 0.0.0.0:9898 0.0.0.0:* 4748/domoticz
What is in your case?
User avatar
vetalok
Posts: 22
Joined: Friday 30 December 2016 12:40
Target OS: Linux
Domoticz version: 3.6273
Location: Lviv, Ukraine
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by vetalok »

arkoko wrote:It means that something using 9898 port.
netstat -tulpn part from my pi:
udp 0 0 0.0.0.0:9898 0.0.0.0:* 4748/domoticz
What is in your case?
netstat -tulnp | grep 9898
udp 2496 0 0.0.0.0:9898 0.0.0.0:* 30151/python
arkoko
Posts: 34
Joined: Saturday 17 December 2016 12:13
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Estonia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by arkoko »

sudo ls -l /proc/30151/exe
ps aux |grep 30151
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by corbin »

Do you know what is already using port 9898? I guess my code still crashes - which I would like to fix, but you can't be running two sockets on the same port.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
User avatar
vetalok
Posts: 22
Joined: Friday 30 December 2016 12:40
Target OS: Linux
Domoticz version: 3.6273
Location: Lviv, Ukraine
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by vetalok »

corbin wrote:Do you know what is already using port 9898? I guess my code still crashes - which I would like to fix, but you can't be running two sockets on the same port.
https://pypi.python.org/pypi/pdbx/0.3.0

Remote PDB Debugger use port 9898
levynger
Posts: 87
Joined: Wednesday 21 December 2016 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Israel
Contact:

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by levynger »

corbin wrote:Switches now have the extra options:

xiaom_switches.PNG
Thanks!
Just updated from git,
the wireless switch now identifies as Selector, after adding as switch, no way to edit and it recieved only "off" commands.
WirelessSwitch.PNG
WirelessSwitch.PNG (7.07 KiB) Viewed 2169 times
WirelessSwitch_Added.PNG
WirelessSwitch_Added.PNG (19.35 KiB) Viewed 2169 times
Any ideas?


EDIT: i have added it manually, and it works!!
the Long Press appears twice in logs (one for press and once for release i assume)
Last edited by levynger on Saturday 31 December 2016 12:01, edited 1 time in total.
Coldman
Posts: 61
Joined: Saturday 17 December 2016 11:51
Target OS: Linux
Domoticz version: Beta
Location: Moscow, Russia
Contact:

Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by Coldman »

corbin wrote:only in my repository at this stage, so something like this:

git clone https://github.com/corbinmunce/domoticz.git domoticz
I have installed from your repositary, how to I can update it, or I should installing again full version?

Sent from my MI PAD 2 using Tapatalk
levynger
Posts: 87
Joined: Wednesday 21 December 2016 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Israel
Contact:

Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by levynger »

Coldman wrote:
corbin wrote:only in my repository at this stage, so something like this:

git clone https://github.com/corbinmunce/domoticz.git domoticz
I have installed from your repositary, how to I can update it, or I should installing again full version?

Sent from my MI PAD 2 using Tapatalk
I also moved from offical to corbin's git, i simply installed in a different folder and restored DB into it.
Coldman
Posts: 61
Joined: Saturday 17 December 2016 11:51
Target OS: Linux
Domoticz version: Beta
Location: Moscow, Russia
Contact:

Re: RE: Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Post by Coldman »

levynger wrote:
Coldman wrote:
corbin wrote:only in my repository at this stage, so something like this:

git clone https://github.com/corbinmunce/domoticz.git domoticz
I have installed from your repositary, how to I can update it, or I should installing again full version?

Sent from my MI PAD 2 using Tapatalk
I also moved from offical to corbin's git, i simply installed in a different folder and restored DB into it.
Thanks

Отправлено с моего MI PAD 2 через Tapatalk
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest