Is the recently added daylight sensor supposed to work already? I am seeing it greyed out as unreachable in Phoscon, and this is what it looks like from a REST API perspective:
{
"28": {
"config": {
"configured": false,
"on": true,
"sunriseoffset": 30,
"sunsetoffset": -30
},
"etag": "e58b9cbce8e2395ee66e4b238f2bcd41",
"manufacturername": "Philips",
"modelid": "PHDL00",
"name": "Daylight",
"state": {
"daylight": null,
"lastupdated": "none",
"status": null
},
"swversion": "1.0",
"type": "Daylight"
}
}
Updated to latest firmware and deconz version, including extra restart to no avail.
It should have configured itself from the dresden appspot server, but apparently it hasn't. You might wanna try setting config.lat and config.long to you GPS coordinates.
Yes the auto configuration only works if internet discovery is enabled (old WebApp settings) and the gateway can reach out to the update server.
Enabling internet discovery and restarting deconz did the trick. Sensor is behaving as expected now!
Hmm, I'm still seeing this with version 2.05.65. config.lat/long not showing via REST API, and I don't seem to be able to set them. Internet discovery is on and I have restarted the app. Any clues?
Actually possibly different issue, is this "greyed out"?

If not I have a different problem - I just cannot use the sensors in a rule, as I cannot create a daylight rule:

Create button is greyed out?
config.lat/long not showing via REST API
That's considered a security feature, so malicious apps cannot read your physical location. When the sensor has been configured, it shows config.configured as true:
$ ph get /sensors/1
{
"config": {
"configured": true,
"on": true,
"sunriseoffset": 0,
"sunsetoffset": 0
},
"etag": "ea3eaaabdd76dc20cc61b7280d7666f1",
"manufacturername": "Philips",
"modelid": "PHDL00",
"name": "Daylight",
"state": {
"dark": false,
"daylight": true,
"lastupdated": "2019-07-14T04:29:38",
"status": 160
},
"swversion": "1.0",
"type": "Daylight",
"uniqueid": "00:21:2e:ff:ff:01:02:56-01"
}
You can set the coordinates manually by (yes, I live in Amsterdam):
$ ph put /sensors/1/config '{
"long": "4.9098",
"lat": "52.3423",
"sunriseoffset": 0,
"sunsetoffset": 0
}'
This is different from the Hue API (see https://github.com/dresden-elektronik/deconz-rest-plugin/issues/495), which expects the long value to end with E or W and lat value with N or S. I think the deCONZ API uses negative numbers for W and S.
If you want to check the configured values, they're stored in the sensors table in the database, ~/.local/share/dresden-elektronik/deCONZ/zll.db. I use sqlitebrowser to examine (and patch) it. Make sure deCONZ has been shutdown and make a backup before patching, though.
Ah, OK, makes sense - thank you.
As per my second comment above, I'm thinking it's actually possibly a bug / missing feature in the JS for the new WebApp?
// currently only PIR supported
Ā if (controlType === 'pir' && val.length > 0 && !$parent.hasClass("has-error")) {
Ā $btn.removeAttr("disabled");
Ā $btn.on('click', createSensorControl);
Ā app.$createSensorControlModal.removeClass('is-flsnb');
Ā } else if (controlType === 'flsnb') {
Ā $btn.removeAttr("disabled");
Ā $btn.on('click', createSensorControl);
Ā app.$createSensorControlModal.addClass('is-flsnb');
Ā } else {
Ā $btn.attr("disabled", "disabled");
Ā app.$createSensorControlModal.removeClass('is-flsnb');
Ā }
Is there an alternative approach I can use?
I wouldnāt know; I donāt use Phoscon and itās not open source. Iāve created all my rules myself, with advanced logic like: open the bedroom curtains 10 min after my wakeup alarm went off if itās already light, or at sunrise when it becomes light after my wakeup alarm went off.
Ah, OK - I'm a bit muddled about who authors what and who works for who!
I am "just" a deCONZ user who contributes to the REST API plugin (this repository). I'm also the author of homebridge-hue, and a number of other homebridge plugins, see https://github.com/ebaauw. All my efforts here on GitHub are out of a hobby (gone wild), unrelated to my daytime job.
dresden elektronik provide the following deCONZ components:
general.xml.There's many (open source) apps or plugins for home automation systems provided by others that interface with these components. Most use the REST API:
Also noteworthy is the deCONZ CLI plugin, which provides command-line interface to your ZigBee devices, using the C++ API.
Brilliant info - thanks for going above and beyond in providing that! It looks like Home Assistant might be good for me ..
Maybe Iām just stupid, but how can I make sure the new lat and long values are stored?
Iām using postman and get status 200 when posting, but when I get the status of the sensor, there are no lat and long values in the response
Thatās to protect your privacy. Through the API, you can check whether config.configured is set. If you want to check the values youāll have to access the database directly.
Thatās to protect your privacy. Through the API, you can check whether
config.configuredis set. If you want to check the values youāll have to access the database directly.
Ahh. That makes sense. So I can be somehow sure that the values are stored if it returns 200? I used your ātemplateā here in the thread š
Most helpful comment
I am "just" a deCONZ user who contributes to the REST API plugin (this repository). I'm also the author of homebridge-hue, and a number of other homebridge plugins, see https://github.com/ebaauw. All my efforts here on GitHub are out of a hobby (gone wild), unrelated to my daytime job.
dresden elektronik provide the following deCONZ components:
general.xml.There's many (open source) apps or plugins for home automation systems provided by others that interface with these components. Most use the REST API:
Also noteworthy is the deCONZ CLI plugin, which provides command-line interface to your ZigBee devices, using the C++ API.