en3rgy / 14100_hue Goto Github PK
View Code? Open in Web Editor NEWGira HS logic module to control Philips Hue
License: MIT License
Gira HS logic module to control Philips Hue
License: MIT License
Rooms can not be controlled directly vi API v2 nevertheless a functionaliit y to switch on / off complete rooms is appreciated, see https://knx-user-forum.de/forum/%C3%B6ffentlicher-bereich/knx-eib-forum/1451665-neuer-baustein-hue-group-14100?p=1855837#post1855837
In introduction, referenc eto E1 - E3 is wrong (old inputs).
En3rGy : Schau mal du bist an der Sache aktiver dran als ich... ich hab das mit den Lichtern und den Gruppen in meinem Baustein ja so gelöst das es einen Eingang für ein Gerät und eine für Gruppen gibt. Und im Baustein frag ich das dann entsprechend so ab:
Code:
if self.id > 0:
self.base = "/api/{0}/lights/{1}".format(self.key,self.id)
self.mode = "state"
self.ident = "D{0}".format(self.id)
if self.gid > 0:
self.base = "/api/{0}/groups/{1}".format(self.key,self.gid)
self.mode = "action"
self.ident = "G{0}".format(self.gid)
und entsprechend verwende ich dann in den Funktionen die Vars ... :-) vielleicht kannst du es ja ähnlich so adaptieren :-)
Gruß
Paul
ability to choose between (0-100%) or (0-255) since the gira color picker is using 0-100%.
I know you can do some calculation, but that makes it more complicated, especially when using the module in scenes.
Add a link to a webpage which describes how to add a hue user. e.g. https://www.tutonaut.de/en/instructions-address-hue-api-aka-create-users/
E.g. either as stand alone webpage or on HS debug page
See HS docu to share data among multiple modules: /doc_extra/de/commloginst.html
When i put 1 light on, the other that is in the same group does the same after 1 sec. I'm not using the group id.
When i put the same light out, the other stays on.
Changing the color does not have the same issue. Only the put on is responding to that command.
Allow relative dimm based on knx msgs
The module should have a dedicated input to enter the bridge IP.
The given IP shall be prioritised before a automatic IP discovery.
RGB to xy conversion seems buggy. rgb = (0, 255, 0) results in some kind of yellow
Min brightness in hue app is 1% when using the dim function. The corrsponding abs value is 0 while for 100% it's 254.
Output RM Brighness shall send 1% when the internal value is 0.
Starting with v3.9, input 8 is out of function.
Exception when calling dynamic scene.
expert 4.11
no reaction from lamps, neither groups
Debug page shows this error.
AttributeError: HueGroup_14100_14100 instance has no attribute 'PIN_I_NGROUP'
Read gamu_type from bulb (https://developers.meethue.com/develop/hue-api-v2/api-reference/#resource_light_get)
Include repository from https://github.com/benknight/hue-python-rgb-converter
I found a way to use the room name to get the group id (since you cannot turn on/off rooms)
When you look at the /resource/grouped_light the grouped lights in question have an owner, this is the room in which the lights are.
So with some hack code i'm able to get the ID from the name -> RID -> ID. This way i can adjust my own code and keep it working with V2.😂
I know you have your own code to deal with and the bugs that come with that. But this might help in the future, so just sharing for that and not to pester you to implement it 😊
Code:
import json
import httplib
import ssl
def call_https_hue(ipadres, path):
h = httplib.HTTPSConnection(ipadres,context=ssl._create_unverified_context())
headers = {"Content-type": "text/plain" ,"hue-application-key": "myhuekey"}
h.request('GET', path, headers=headers)
return h
roomname = ("Eetkamer")
ipadres = ('192.168.178.128')
path = ('/clip/v2/resource/room')
h = call_https_hue(ipadres,path)
r = json.load(h.getresponse())
for i, member in enumerate(r['data']):
x = str(member['metadata']['name'])
if x.lower() == roomname.lower():
index_a = i
naam = (r['data'][index_a]['metadata']['name'])
rid = (r['data'][index_a]['id'])
print(naam)
print(rid)
path = ('/clip/v2/resource/grouped_light')
k = call_https_hue(ipadres,path)
l = json.load(k.getresponse())
for i, member in enumerate(l['data']):
x = (member['owner']['rid'])
if x == rid:
index_b = i
id = (l['data'][index_b]['id'])
print(id)
roomname is the one i can change in whatever room and it will spit out the ID at the end. (the one before that is the Owner ID)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.