Kodi Community Forum

Full Version: YeeMee - (Control Yeelight Smart Bulb + Ambi from Kodi)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Dalibor,

done - everything is the same beside the DNS server. Without VPN system using router as DNS server with VPN other DNS is used. As I thought IPs/Subnet are still the same. So the questions is, why dose the DNS affect the Yeelight Addon?
(2017-10-23, 15:54)Dibbele Wrote: [ -> ]Hi Dalibor,

done - everything is the same beside the DNS server. Without VPN system using router as DNS server with VPN other DNS is used. As I thought IPs/Subnet are still the same. So the questions is, why dose the DNS affect the Yeelight Addon?

Probably because your new VPN DNS server, which is WAN (internet) somewhere, doesn't know your LAN...
So I managed to have primary DNS set to local router as it is without VPN but still the same error. So it can´t be the DNS or at least not the primary. Sad
Well, it looks like it is caused by the VPN, so the problem is really not in the addon...
Strange strange. Since I am not at all an programmer or developer looking at lines of code will not be very meaningful to me. So I have to live with the fact that is not working with this VPN used. I will try some more with other VPNs and see if it is a general problem or just with CyberGhost. Thanks anyway for this great addon. Big Grin
(2017-10-24, 08:46)Dibbele Wrote: [ -> ]Strange strange. Since I am not at all an programmer or developer looking at lines of code will not be very meaningful to me. So I have to live with the fact that is not working with this VPN used. I will try some more with other VPNs and see if it is a general problem or just with CyberGhost. Thanks anyway for this great addon. Big Grin

Nothing to do with the lines of code. Addon is working just fine. It is a networking issue...
(2017-10-24, 08:46)Dibbele Wrote: [ -> ]Strange strange. Since I am not at all an programmer or developer looking at lines of code will not be very meaningful to me. So I have to live with the fact that is not working with this VPN used. I will try some more with other VPNs and see if it is a general problem or just with CyberGhost. Thanks anyway for this great addon. Big Grin

Hmm, one thing comes to mind that we could check Smile Would you know how to edit the script file, I'd tell you exactly what needs to be changed?
Sure, no problem. Will notepad++ do the trick? Or is another editor needed?
(2017-10-24, 09:48)Dibbele Wrote: [ -> ]Sure, no problem. Will notepad++ do the trick? Or is another editor needed?

Any editor will do :SmileO, you need to find the folder with addons, and in it is service.yeemee\service.py Edit this file. Search for "def get_ip():".


Code:
def get_ip():
   s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   try:
       # doesn't even have to be reachable
       s.connect(('10.255.255.255', 1))
       IP = s.getsockname()[0]
   except Exception:
       IP = '127.0.0.1'
   finally:
       s.close()
   return IP

change to (add 1 line):

Code:
def get_ip():
   s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
   try:
       # doesn't even have to be reachable
       s.connect(('10.255.255.255', 1))
       IP = s.getsockname()[0]
   except Exception:
       IP = '127.0.0.1'
   finally:
       s.close()
   xbmc.log('YEEMEE >> IP: ' + str(IP))
   return IP

So, to resume, you are adding line

Code:
   xbmc.log('YEEMEE >> IP: ' + str(IP))

Turn on debug logging in settings, and restart Kodi, play something with Ambi function. Exit Kodi. Get the log and see what IP it wrote in log.

D.
DaLanik

"Ambi and normal control service work differently. Normal control sends commands through LAN directly to the bulb IP adress. Ambi service creates server that is sending data to the bulb and tells the bulb the IP adress of the server. Then the bulb "listens" to the commands from server (Kodi, that is, YeeMee addon).

I don't think implementing that would be easy, it would have to be on the OS level, since it would need to grab the screens outside of Kodi. So that is a no."

So this is what solved my problem, I was sure that there was diferent implemetation, Due to being a little security freak I had the lights on diferent vlan with access from that vlan to the internet and from my vlan also to that vlan (one direction). So when you sead that is creates a socket and then listens to that socket I was sure that this was the problem. I changed the firewall rules and voila!

DaLanik thanks again for one of the greatests plugin ever!

P.S. "maybe you can have that detail about the two services being different in implemetation, mentioned in the readme, or on the site...
(2017-10-24, 19:18)gparaskevas Wrote: [ -> ]DaLanik

"Ambi and normal control service work differently. Normal control sends commands through LAN directly to the bulb IP adress. Ambi service creates server that is sending data to the bulb and tells the bulb the IP adress of the server. Then the bulb "listens" to the commands from server (Kodi, that is, YeeMee addon).

I don't think implementing that would be easy, it would have to be on the OS level, since it would need to grab the screens outside of Kodi. So that is a no."

So this is what solved my problem, I was sure that there was diferent implemetation, Due to being a little security freak I had the lights on diferent vlan with access from that vlan to the internet and from my vlan also to that vlan (one direction). So when you sead that is creates a socket and then listens to that socket I was sure that this was the problem. I changed the firewall rules and voila!

DaLanik thanks again for one of the greatests plugin ever!

P.S. "maybe you can have that detail about the two services being different in implemetation, mentioned in the readme, or on the site...

Aha, that explains it... I thought it logical bulbs/kodi must be in the same VLAN... Smile
(2017-10-24, 11:08)DaLanik Wrote: [ -> ]Turn on debug logging in settings, and restart Kodi, play something with Ambi function. Exit Kodi. Get the log and see what IP it wrote in log.

D.

IP changes from local to some random ... Sad damn. Without VPN Kodi uses the IP from PC ... don´t know why IP changes to some random other. Not even the one I have when I look on whatsmyip.org.
@gparaskevas

Do you use VPN connection as well and if yes could you explain your setup a little bit more so that I can maybe try to implement it on my home as well?
(2017-10-24, 21:08)Dibbele Wrote: [ -> ]
(2017-10-24, 11:08)DaLanik Wrote: [ -> ]Turn on debug logging in settings, and restart Kodi, play something with Ambi function. Exit Kodi. Get the log and see what IP it wrote in log.

D.

IP changes from local to some random ... Sad damn. Without VPN Kodi uses the IP from PC ... don´t know why IP changes to some random other. Not even the one I have when I look on whatsmyip.org.

Well, yes, to the VPN adress. And it tells the bulbs to go to this adress for data. And since they can't fnd this adress.... Smile
Hi,
I have a yeelight Ceiling light. Everything is working except return to original state (tried with "stop playing") which doesn't restore to previous state, but change the lighting to a little higher, maybe 30 or 40 while my original state was 100. Is there anything you can do?
Kodi 17.4
Thank you.