deconz
deconz copied to clipboard
Feature Request: Expose CLIPGenericFlag sensors/switches to Home Assistant
Possible implementations:
- Expose the flag as a binary_sensor or
- Expose them as a switch:
Map flag
trueto state 'on' and flagfalseto state 'off' turn_on service toPUT /sensors/#/state {"flag": true}turn_off service toPUT /sensors/#/state {"flag": false}
I would prefer the second one.
What is the use case for this? From the look of it this will be a binary sensor. Could you post the json data for a generic flag?
My use case is similar the the one described in this comment: https://github.com/dresden-elektronik/deconz-rest-plugin/issues/98#issuecomment-326562879 I'm using the rule engine of deCONZ and the CLIPGenericFlag is acting as a room's master switch. I would like to see the state of this "master switch" (the flag) in Home Assistant.
Binary sensor would be ok for me. What kind of JSON data do you need? My flag sensor:
{
"config": {
"on": true,
"reachable": true
},
"modelid": "Switch",
"name": "Kitchen Switch",
"state": {
"flag": true,
"lastupdated": "2018-07-01T10:40:35"
},
"swversion": "1.0.0",
"type": "CLIPGenericFlag",
"uniqueid": "kitchen-switch"
}
Seems about right for the flag to be the main state. The Json data you gave me is good enough 👍
Solved in v40.
PR is submitted to HASS, you can expect it to show up with release 0.74
Thanks! One remark: In the code is see:
GENERICFLAG = ['CLIPGenericFLAG']
shouldn't that be:
GENERICFLAG = ['CLIPGenericFlag']
if matching is case sensitive?
My JSON shows "type": "CLIPGenericFlag",
You're right. Good catch!
Updated PR
I'm sorry to bother you again. I think I've found an issue in the GenericFlag class. The is_tripped function is missing. When I use the new code in Home Assistant I get:
File "homeassistant\components\binary_sensor\deconz.py", line 71, in is_on
return self._sensor.is_tripped
AttributeError: 'GenericFlag' object has no attribute 'is_tripped'
Thanks for verifying, will fix immediately
PR is updated
Would it be possible to expose the CLIPGenericFlag as a switch to home assistant so we can toggle the flag easily in Home Assistant on and off?
@Krocko can you create a new issue with examples on how it is set, and why it is useful
https://github.com/ebaauw/homebridge-hue/wiki/Getting-Started#24-clip-sensors
Hi @Kane610. Any news?
I'm nearly done working on the UniFi integration, but I will put my time on the Axis integration prior to revisiting deconz
Ok. Thank you for the info.
Hello @Kane610 any update on this?
No news, haven't investigated this at all
Hi @Kane610. Do you have any news?
Still waiting on examples
[Kane610](https://github.com/Kane610) commented [on 21 Dec 2019](https://github.com/Kane610/deconz/issues/14#issuecomment-568201742)
@Krocko can you create a new issue with examples on how it is set, and why it is useful
Hello @Kane610 Do you need more info?