Fuchs / hoppla-sa

Linux / KDE Plasma desktop widget to control Philips Hue lights. Controls lights, groups and customizable actions.
https://store.kde.org/p/1168067/
GNU Lesser General Public License v2.1
66 stars 6 forks source link

[feature request] set date/time on the bridge #10

Open hopplaitsbehindyou opened 5 years ago

hopplaitsbehindyou commented 5 years ago

it would be nice to be able to see and change the date and time set on the bridge in case you can't or don't want to connect it to the internet and it doesn't reach a NTP server

this can be done via API as explained in the following page under section "Setting the time" https://www.drashsmith.com/post/running-philips-hue-lights-locally/

a way to implement this could be to add a date/time field in configuration->bridge to enter the date/time manually and also a checkbox

[ ] synchronize bridge date/time with local computer

that could take the local system time when the widget starts up (and maybe every 24h) and set it on the bridge (i'd take and set UTC to avoid issues with different time zones on local computer and bridge)

and if desired more /config fields can be added to the bridge->configuration tab besides date/time:

"name": "Ash's Lights", "zigbeechannel": 20, "dhcp": true, "ipaddress": "192.168.0.70", "netmask": "255.255.255.0", "gateway": "192.168.0.1", "proxyaddress": "none", "proxyport": 0, "UTC": "2016-12-14T23:23:28", "localtime": "2016-12-14T23:23:28", "timezone": "Europe/London", "modelid": "BSB001",

dhcp/ipaddress/netmask/gateway/proxy to set a static IP (i had to use a smartphone just to disable DHCP and set a static IP)

time zone to select the time zone (i guess as per /usr/share/zoneinfo)

and thanks for this great widget! it makes it possible to control phillips hue without a smartphone and looks great

Fuchs commented 5 years ago

Hi,

thank you very much for the suggestion. As you can see in the latest commit I am currently starting to implement parts of the /config API, currently reading only though, to get the API version because 1.30 added some new features I sort of have to support. (Which is my current priority)

Adding want you want is slightly limited by two things:

1) the applet is and always will be pure QML, for the reason that as soon as it has a backend I can no longer distribute it via the KDE store / get new widgets easily. So reading out local settings is something that needs to be supported there, which I have to check.

2) Personally I don't want to overcrowd the settings dialogue with too many items that 95% of users will never need. So it will have to go under some sort of advanced settings tab or page, not shown right away by default.

What I plan to do is to re-work the settings to have some sort of bridge management so you can also configure multiple bridges, but that's opening the box of pandora and will need a lot of rewriting and work, so it can't be done in a quick way.

You can, however, in the meantime change all these settings without having a smartphone: http://IP OF YOUR BRIDGE HERE/debug/clip.html exposes a small web form where you can read and change everything via the API without having to go via curl, which is slightly more comfortable. What you are e.g. looking for is:

{"dhcp": false}

as the Message Body via PUT for the URL

/api/yourAuthenticationTokenWhichYouCanGetFromHopplaConfigHere/config

You can get all possible values via GET on the same URL.

It's not nice, but it's a workaround until I managed to implement support, which I can't give you an ETA for right now sorry.

Thanks for using my plasmoid and have a great weekend!

hopplaitsbehindyou commented 5 years ago

hi Fuchs,

thank you very much for the quick response! regarding the applet being QML that's the reason why i didn't bring up the other topic about picking colors depending on desktop background -which i don't know if it can be done. but since there are clock applets i guess it should be possible to read the system time, if not then there will be no way to implement this

regarding the overcrowded settings dialogue i agree, i just can't see how the settings window looks like since i'm at work and rely on pictures found with google images. but when i saw one i considered the same, that if done it would look better in a separate tab for (advanced) Bridge Settings. i just found that page this morning and i wanted to post it right away, also for myself -as you mentioned i can now manually set the time and IP/network settings on the bridge with commands myself (great!). but if it can be implemented some day in your plasmoid (very low priority) i think it would be great too, as it gives the possibility to not have to use a smartphone and proprietary software at all (i only use your plasmoid to control the philips hue lights manually + the kodi plugin + the remote control. but no smartphone and no official app!)

thanks for your feedback and your suggestions and you too, have a nice weekend.

and thanks again for the great plasmoid!