YinHangCode / homebridge-mi-philips-light

XiaoMi Philips light plugins for HomeBridge.
99 stars 18 forks source link

TableLamp2 #1

Open acc-ua opened 7 years ago

acc-ua commented 7 years ago

Thanks for your time doing the plugin. Waiting for the next update to make TableLamp2 working as well.

hwgverbeek commented 7 years ago

This is a gewag plug-in, i really hope you can update it with the table lamp 2 support! And idea when you can fix this ? I am really gratefull for all your efforts!

YinHangCode commented 7 years ago

I have plans to develop it, But I don't have this device, so I haven't developed it yet. I bought a second-hand one the day before yesterday, but the seller hasn't shipped it yet. So it should be come soon.

hwgverbeek commented 7 years ago

Really cool :) Thank you for your reply and effort.

Best regards Harm

Op 10 okt. 2017 om 08:09 heeft Mr.Yin notifications@github.com<mailto:notifications@github.com> het volgende geschreven:

I have plans to develop it, But I don't have this device, so I haven't developed it yet. I bought a second-hand one the day before yesterday, but the seller hasn't shipped it yet. So it should be come soon.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/YinHangCode/homebridge-mi-philips-light/issues/1#issuecomment-335370670, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfI57pAAfe4no_25hBu-cGW5cEkMX676ks5sqwn6gaJpZM4PWDNR.

acc-ua commented 7 years ago

Actually, Philips Eyecare lamp works with SmartBulb interface as well. But of course, it has no Eyecare level/Ambient light properties and Brightness doesn't work for it. This is strange since Brightness is defined as valid property in https://github.com/aholstenson/miio/blob/master/lib/devices/eyecare-lamp2.js

hwgverbeek commented 7 years ago

Hmm, is there a solution possible you think ?

Best regards Harm

Op 10 okt. 2017 om 10:25 heeft acc-ua notifications@github.com<mailto:notifications@github.com> het volgende geschreven:

Actually, Philips Eyecare lamp works with SmartBulb interface as well. But of course, it has no Eyecare level/Ambient light properties and Brightness doesn't work for it. This is strange since Brightness is defined as valid property in https://github.com/aholstenson/miio/blob/master/lib/devices/eyecare-lamp2.js

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/YinHangCode/homebridge-mi-philips-light/issues/1#issuecomment-335398789, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfI57vBuDWLxbynBm_d6DJBdR6KgikXUks5sqynYgaJpZM4PWDNR.

acc-ua commented 7 years ago

well, you can turn on/off using Smartbulb interface at the moment.

But, for other functions we probably will need to wait for plugin update.

I planned to add some code, but stucked with some HomeKit specific issues and have no time to figure out how to implement everything correctly.

hwgverbeek commented 7 years ago

I tested the tablelamp2 under lightbulb mode, funny enough it gives an error when you want to change the brightness, but it does work. It says error, but it does exactely as you want. I really hope you can fix it later on, would be awesome for this cool lamp.

YinHangCode commented 7 years ago

@acc-ua @hwgverbeek updated 0.1.0, add support for Philips Table Lamp 2.

acc-ua commented 7 years ago

fantastic, thanks a lot!

hwgverbeek commented 7 years ago

I tried it out, it doesnt seem to work yet

"platforms": [

{
    "platform": "MiPhilipsLightPlatform",
    "type": "TableLamp2",
    "ip": "192.168.01.36",
    "token": "the correct one",
    "lightName": "Bureaulamp",
    "secondLightName": "Burealamp achter",
    "secondLightDisable": false
 },

I only added this because i dont own a normal bulb just tablelamp2 what is going wrong ?

YinHangCode commented 7 years ago

@hwgverbeek

"platforms": [{
    "platform": "MiPhilipsLightPlatform",
    "deviceCfgs": [{
        "type": "TableLamp2",
        "ip": "192.168.1.36",
        "token": "ur token",
        "mainLightName": "Bureaulamp",
        "secondLightName": "Burealamp achter",
        "secondLightDisable": false
    }]
}]
hwgverbeek commented 7 years ago

"platforms": [

{
    "platform": "MiPhilipsLightPlatform",
    "deviceCfgs": [{
    "type": "TableLamp2",
    "ip": "192.168.01.36",
    "token": "9e3ef6894ef0395706bef3dfb7efb66a",
    "mainLightName": "Bureaulamp",
    "mainLightDisable": false,
    "secondLightName": "Burealamp achter",
    "secondLightDisable": false
    }]

}]

No mainLightDisable line needed ? It seems it is hard to control the brightness of the 2 lamps individually, perhabs that is an option for the future together with eyecare ?

It works btw, dont know what the effect is of mainLightDisable added or not?

acc-ua commented 7 years ago

Just tested the plugin - works fine. Thanks again.

mainLightDisable or lightDisable seems to be unused, but secondLightDisable works correctly.

YinHangCode commented 7 years ago

@acc-ua @hwgverbeek
it's not need mainLightDisable or lightDisable, mainLight must enable, because of secondLight can't control all the lights. mainLight swtich almost equal to 1 in the following picture. secondLight swtich almost equal to 2 in the following picture. mainLight brightness almost equal to 3 in the following picture. secondLight brightness almost equal to 4 in the following picture.

1

2

3

hwgverbeek commented 7 years ago

Thank you for your feedback!, is it possible to make a switch 3 for the eyecare ? Perhabs you can set the example

{ "platform": "MiPhilipsLightPlatform", "deviceCfgs": [{ "type": "TableLamp2", "ip": "192.168.01.36", "token": "9e3ef6894ef0395706bef3dfb7efb66a", "mainLightName": "Bureaulamp", "mainLightDisable": false, "secondLightName": "Burealamp achter", "secondLightDisable": false }]

on the frontpage as an extra for those who dont have xaomi lightbulbs ? I am really gratefull you found the time to fix and support this!

YinHangCode commented 7 years ago

@hwgverbeek updated 0.1.1, add Philips Table Lamp 2 eyecare mode switch accessory.

acc-ua commented 7 years ago

Eyecare mode works good. Just curious, are there any ways to group such switches into a single one with HomeKit?

hwgverbeek commented 7 years ago

It works really well, thank you for such fast implementing this, great work! It works perfectly, now it is possible to use it also with iftt or other homekit accessoiries!

I only find a problem with siri, i seem to only give a command targeted at the whole lamp instead of the different sub-switches. Is there anything what can be done to solve this?

hwgverbeek commented 7 years ago

unfortunally with the new version i get [MiPhilipsLightPlatform][ERROR]TableLamp2 - MainLight - setPower Error: Error: Call to device timed out You have any idea what the problem might be ?

YinHangCode commented 7 years ago

@hwgverbeek make sure ur ip and token is right.

hwgverbeek commented 7 years ago

both are right, i double checked

hwgverbeek commented 7 years ago

hmmm strange sorry, somehow the token got different without me resetting or doing anything. Tried to find it again with discover. thx for your help

YinHangCode commented 7 years ago

@hwgverbeek
you can try use miio2.db get token. Get MiIo Tokens By DataBase File

jmramirezpro commented 6 years ago

Hi!

I have a problem. My TableLamp2 its working but now don't work and I don't change they token. I can see the same error of @hwgverbeek

[MiPhilipsLightPlatform][ERROR]TableLamp2 - MainLight - setPower Error: Error: Call to device timed out

I extract the file miio2.db from an Android unlocked device and test with Get MiIo Tokens By DataBase File. The token its the same on past. I don't know why not working.

My config.json its this:

 {
      "platform": "MiPhilipsLightPlatform",
      "deviceCfgs": [{
          "type": "MiPhilipsSmartBulb",
          "ip": "192.168.1.122",
          "token": "06f5510636b05b32d6279f9d2ad2c74f",
          "lightName": "Bombilla del salon",
          "lightDisable": false
      }, {
          "type": "MiPhilipsTableLamp2",
          "ip": "192.168.1.109",
          "token": "7069734fd6f1684fcfffa3e694b4ff49",
          "mainLightName": "living room table lamp",
          "secondLightName": "living room table lamp amb",
          "secondLightDisable": false,
          "eyecareSwitchName": "living room table lamp eyecare model",
          "eyecareSwitchDisable": false
      }]
    }

I clear the cache, delete my house on iOS App Home and add it again all devices and still not work. Others devices like MiPhilipsSmartBulb works perfectly. The IP its right too.

Have you got any ideas? I hope yours news

Thanks in advance!

Regards! Jose Manuel

jmramirezpro commented 6 years ago

@YinHangCode Have you got any idea of my problem? Thanks!!