Giter Club home page Giter Club logo

Comments (10)

Kane610 avatar Kane610 commented on June 16, 2024 1

It is already supported by the sensor so I will add it as an attribute. Will look into this next week. No need to rush since the new beta period has already started. There would just be too many entities created if a switch would be generated for each sensor.

For turning on and off there already is a service for that. It's generic but you can just specify entity and send that payload.

from deconz.

Kane610 avatar Kane610 commented on June 16, 2024 1

Pushed an update, try it out now

from deconz.

Kane610 avatar Kane610 commented on June 16, 2024

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

from deconz.

snozzlebert avatar snozzlebert commented on June 16, 2024

Did some testing for this one also. Initial on attribute state works. Changes are not reported.
I think it is related to the on attribute missing here? https://github.com/Kane610/home-assistant/blob/c5d89ece993d02bc888e99bdbbf089d233b4c300/homeassistant/components/binary_sensor/deconz.py#L63

Here is the log after triggering the change of config.on using the deconz.configure service:

2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.utils] Sending {'data': '{"on": false}'} to http://192.x.x.x:80/api/<redacted-api-key>/sensors/62/config
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{'success': {'/sensors/62/config/on': False}}]
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update alert with none
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update battery with 100
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update delay with 0
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update ledindication with False
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update on with False
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update reachable with True
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update sensitivity with 2
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update sensitivitymax with 2
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.deconzdevice] Motion Sensor: update usertest with False
2018-07-02 21:23:11 DEBUG (MainThread) [pydeconz.websocket] Websocket data: {"config":{"alert":"none","battery":100,"delay":0,"ledindication":false,"on":false,"reachable":true,"sensitivity":2,"sensitivitymax":2,"usertest":false},"e":"changed","id":"62","r":"sensors","t":"event"}

Call is succesful. Websocket shows the new state of the config attribute (false). However, there is no update of the attribute in the Home Assistant entity

from deconz.

Kane610 avatar Kane610 commented on June 16, 2024

Thanks for testing it so rigorously! I apologise for all these misses

from deconz.

snozzlebert avatar snozzlebert commented on June 16, 2024

Thanks. I can confirm that all changes work as expected now.

from deconz.

snozzlebert avatar snozzlebert commented on June 16, 2024

Just for your information, I'm using this template switch to view and toggle the config.on state of a motion sensor:

switch:
  - platform: template
    switches:
      motion_kitchen:
        value_template: "{{ states.binary_sensor.motion_kitchen.attributes.on }}"
        turn_on:
          service: deconz.configure
          data:
            field: /sensors/62/config
            data:
              "on": true
        turn_off:
          service: deconz.configure
          data:
            field: /sensors/62/config
            data:
              "on": false

from deconz.

Kane610 avatar Kane610 commented on June 16, 2024

Great! PR is approved so it is ready to be merged, perfect timing. Thanks for your support!

from deconz.

Kane610 avatar Kane610 commented on June 16, 2024

I might put this in as an example on how to use the "on" attribute. Nice idea!

from deconz.

Kane610 avatar Kane610 commented on June 16, 2024

It is now available on HASS dev branch

from deconz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.