You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.
I seek assistance adding a unique hub-id/bridgeid to a PHD sensor (which isn't yet in the intregration, but running fully functionally in my local setup)
def parse_phd(response):
"""Parse the json for a PHD Daylight sensor and return the data."""
if response["type"] == "Daylight":
daylight = response["state"]["daylight"]
name_raw = response["name"]
name = "Hue " + name_raw + " custom"
if daylight is True:
state = STATE_ON
else:
state = STATE_OFF
if daylight is not None:
data = {
"model": "PHD",
"state": state,
"on": response["config"]["on"],
"configured": response["config"]["configured"],
"sunrise_offset": response["config"]["sunriseoffset"],
"sunset_offset": response["config"]["sunsetoffset"],
"name": name,
"type": response["type"],
"modelid": response["modelid"],
"swversion": response["swversion"],
"daylight": daylight,
"last_updated": response["state"]["lastupdated"].split("T"),
"manufacturername": response["manufacturername"]
}
else:
data = {
"model": "PHD",
"state": "No Daylight data",
"on": None,
"configured": None,
"sunrise_offset": None,
"sunset_offset": None,
"name": None,
"type": None,
"modelid": None,
"swversion": None,
"daylight": "No Daylight data",
"last_updated": None,
"manufacturername": None
}
return data
is what the sensor currently is made of, with a suffix custom in the name.
Ideally the entity_id should get a unique humid too, so in multiple hub setups, these entities can be distinguished from each other. This is a Hub builtin sensor called Daylight.
please consider adding this to the integration, and please help me adding the unique hubid previously done like this:
if modelid == "PHD":
_key = modelid + "_" + bridgeid
if _key not in data_dict:
data_dict[_key] = parse_phd(sensor)
else:
data_dict[_key].update(parse_phd(sensor))
and now added to the hue_api(repsonse) as follows:
elif modelid == "PHD":
_key = modelid
if _key not in data_dict:
data_dict[_key] = parse_phd(sensor)
else:
data_dict[_key].update(parse_phd(sensor))
thanks for having a look and considering!
The text was updated successfully, but these errors were encountered:
HI, as explained here: #222
I seek assistance adding a unique hub-id/bridgeid to a PHD sensor (which isn't yet in the intregration, but running fully functionally in my local setup)
is what the sensor currently is made of, with a suffix custom in the name.
Ideally the entity_id should get a unique humid too, so in multiple hub setups, these entities can be distinguished from each other. This is a Hub builtin sensor called Daylight.
please consider adding this to the integration, and please help me adding the unique hubid previously done like this:
and now added to the hue_api(repsonse) as follows:
thanks for having a look and considering!
The text was updated successfully, but these errors were encountered: