Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Expose CLIPGenericFlag sensors/switches to Home Assistant #14

Open
snozzlebert opened this issue Jun 28, 2018 · 21 comments
Assignees

Comments

@snozzlebert
Copy link

Possible implementations:

  • Expose the flag as a binary_sensor
    or
  • Expose them as a switch:
    Map flag true to state 'on' and flag false to state 'off'
    turn_on service to PUT /sensors/#/state {"flag": true}
    turn_off service to PUT /sensors/#/state {"flag": false}

I would prefer the second one.

@Kane610
Copy link
Owner

Kane610 commented Jun 30, 2018

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?

@snozzlebert
Copy link
Author

My use case is similar the the one described in this comment: dresden-elektronik/deconz-rest-plugin#98 (comment)
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"
    }

@Kane610
Copy link
Owner

Kane610 commented Jul 1, 2018

Seems about right for the flag to be the main state. The Json data you gave me is good enough 👍

@Kane610 Kane610 self-assigned this Jul 1, 2018
@Kane610
Copy link
Owner

Kane610 commented Jul 1, 2018

Solved in v40.

PR is submitted to HASS, you can expect it to show up with release 0.74

@Kane610 Kane610 closed this as completed Jul 1, 2018
@snozzlebert
Copy link
Author

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",

@Kane610
Copy link
Owner

Kane610 commented Jul 2, 2018

You're right. Good catch!

@Kane610
Copy link
Owner

Kane610 commented Jul 2, 2018

Updated PR

@snozzlebert
Copy link
Author

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'

@Kane610
Copy link
Owner

Kane610 commented Jul 2, 2018

Thanks for verifying, will fix immediately

@Kane610
Copy link
Owner

Kane610 commented Jul 2, 2018

PR is updated

@Krocko
Copy link

Krocko commented Dec 21, 2019

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?

@Kane610
Copy link
Owner

Kane610 commented Dec 21, 2019

@Krocko can you create a new issue with examples on how it is set, and why it is useful

@Kane610
Copy link
Owner

Kane610 commented Apr 15, 2020

@Kane610 Kane610 reopened this Apr 15, 2020
@Krocko
Copy link

Krocko commented May 11, 2020

Hi @Kane610. Any news?

@Kane610
Copy link
Owner

Kane610 commented May 12, 2020

I'm nearly done working on the UniFi integration, but I will put my time on the Axis integration prior to revisiting deconz

@Krocko
Copy link

Krocko commented May 12, 2020

Ok. Thank you for the info.

@Krocko
Copy link

Krocko commented Jan 28, 2021

Hello @Kane610 any update on this?

@Kane610
Copy link
Owner

Kane610 commented Jan 28, 2021

No news, haven't investigated this at all

@Krocko
Copy link

Krocko commented Mar 6, 2022

Hi @Kane610. Do you have any news?

@Kane610
Copy link
Owner

Kane610 commented Mar 7, 2022

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

@Krocko
Copy link

Krocko commented Aug 3, 2022

Hello @Kane610
Do you need more info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants