nikkow / node-red-contrib-tahoma

Node-RED module to control a Somfy Tahoma box (Roller shutters...). Used for home automation flows.
Apache License 2.0
19 stars 11 forks source link

call getState to know manual changes/sensor values #6

Open Genosse274 opened 6 years ago

Genosse274 commented 6 years ago

It would be nice to read the current state(position), for example after manual control. I also have an sun sensor, which should be readable with the same functionality. Here is all the data from the sensor. Under states - core:LuminanceState is the interesting value.

{"creationTime":xxxxxxxxxx, "lastUpdateTime":xxxxxxxxxxx, "label":"Sonnensensor", "deviceURL":"io://xxxxxxxxxxx", "shortcut":false, "controllableName":"io:LightIOSystemSensor", "definition":{ "commands":[], "states":[{"type":"ContinuousState","qualifiedName":"core:LuminanceState"},{"type":"ContinuousState","qualifiedName":"core:RSSILevelState"}, {"values":["dead","lowBattery","maintenanceRequired","noDefect"],"type":"DiscreteState","qualifiedName":"core:SensorDefectState"}, {"values":["available","unavailable"],"type":"DiscreteState","qualifiedName":"core:StatusState"}], "dataProperties":[{"value":{"activationDelayMap":{"middle":0,"lower":1200,"upper":300},"referenceStates":["middle","lower","upper"], "qualifiedName":"io:SunSensorHysteresisBehavior"},"qualifiedName":"core:timeBasedHysteresisBehavior"}], "widgetName":"LuminanceSensor","uiClass":"LightSensor","qualifiedName":"io:LightIOSystemSensor","type":"SENSOR"},

"states":[ {"name":"core:StatusState","type":3,"value":"available"}, {"name":"core:RSSILevelState","type":2,"value":92.0}, {"name":"core:LuminanceState","type":2,"value": 32956.0} ], "attributes":[ {"name":"core:MeasuredValueType","type":3,"value":"core:LuminanceInLux"}, {"name":"core:MaxSensedValue","type":1,"value":100000}, {"name":"core:MinSensedValue","type":1,"value":50}, {"name":"core:PowerSourceType","type":3,"value":"battery"} ], "available":true, "enabled":true, "placeOID":"xxxxxxx", "widget":"LuminanceSensor", "type":2,"oid":"xxxxxxxxx", "uiClass":"LightSensor" },

taucher4000 commented 6 years ago

I would also be very interested in getting the current position of the shutter.

nikkow commented 6 years ago

I have added both requests to the development version:

However, please node that the luminance thing was not tested on a real device (I currently don't have any sun sensor). Any feedback on that feature would be more than welcome :)

I will merge those items and publish a new release very soon.

Thanks! N.

taucher4000 commented 6 years ago

fantastic, thank you very much!

frankis78 commented 5 years ago

Is it possible to also get the status of the window sensor? I can get the label of the vindow sensor, when i do a getDeviceState , but it doesent publish open or closed {"value":"open","when":1543523953200},{"value":"closed","when":1543523957574}], "historizationMethod":3,"stateName":"core:ContactState", "deviceUnit":"core:AbsoluteValue"}

hmwelsch commented 4 years ago

Luminance reading seems to be left out from official API altogether. Even when this was still working, no luminance device can be found in the device list. I can't test anything right now any more because of issue #23. Is anyone in contact with Somfy about luminance device?