Comments (6)
You can. The virtual group object looks like this:
{
"_id": "tradfri.0.VG-00001",
"type": "channel",
"common": {
"name": "Test"
},
"native": {
"instanceId": 1,
"type": "virtual group",
"deviceIDs": [
65537,
65538
]
},
// ...
}
So once you read the object with getObject
, obj.native.deviceIDs
contains the instance ids of the members. Those are always lightbulbs, so their IDs have the form "tradfri.X.L-YYYYY"
from iobroker.tradfri.
Some background of my question: I have a virtual group with 10 GU-10 bulbs. Sometimes 1-3 bulbs of the group don't react. If i retrigger the switch on/off command it works. My plan was now:
For example turning off all lamps:
- Turn off virtual group
- Check each lamp in group for state still on
- Turn this lamp(s) off again
This works now. Maybe this could be handled from backend/Tradfri adapter too?
from iobroker.tradfri.
This works now. Maybe this could be handled from backend/Tradfri adapter too?
Sounds reasonable, I'll need some additional input though. When that happens:
- Do the lamps which did not react update their state in ioBroker? I imagine they don't.
- Do the virtual group's states get updated?
from iobroker.tradfri.
Do the lamps which did not react update their state in ioBroker? I imagine they don't.
No the status is still tradfri.0.L-65549.lightbulb.state = 'true'
(if i trigger a "off" command)
Do the virtual group's states get updated?
If some bulbs of the VG can't switched, then the VG group state is empty tradfri.0.VG-00001.state = ''
my working workaround is now after turning off the VG group before
var newState = true;
var obj = getObject('tradfri.0.VG-00001');
var members = obj.native.deviceIDs;
members.forEach(function(m) {
var stateId = 'tradfri.0.L-' + m + '.lightbulb.state';
// console.log(stateId);
getState(stateId, function (error, state) {
// console.log(state.val);
if (error) {
console.log(error);
} else {
if (state.val != newState) { // Lampe hat den falschen State, nochmal schalten!
setState(stateId, newState, false, function() {
if (newState) {
log(stateId + ' turned ON again!');
} else {
log(stateId + ' turned OFF again!');
}
});
}
}
});
});
from iobroker.tradfri.
Ok thanks. One more thing:
Does the log show any errors when this happens? Something along the lines of unhandled promise rejection
?
from iobroker.tradfri.
no errors
from iobroker.tradfri.
Related Issues (20)
- tradfri nach Update auf 3.0.0 keine Verbindung mehr HOT 4
- Lost connection to gateway / Connection to gateway reestablished HOT 4
- Update stable version in repo from 2.7.4 to 3.0.1
- Keine Verbindung trotz Update auf 3.0.1 HOT 32
- State value to set for "tradfri.0.B-65572.blind.stop" has to be type "boolean" but received type "function" HOT 1
- Tradfri V1.16.26 verbindet nicht HOT 1
- Add new STARKVIND Air purifier HOT 2
- Neue Fehler im log // neue Firmware? HOT 7
- Starkvind HOT 7
- Ikea Rollo FYRTUR block-out roller Warnungen HOT 2
- Ikea Rollos: found unknown property with key 8 HOT 2
- Think about to fix the issues found by adapter checker HOT 1
- Compatibility check to js-controller 4.0
- BWM Motion Signal HOT 6
- 2x auslösen für Steckdosen und Rollos funktionieren nicht zuverlässig HOT 6
- level.color.rgb is not RGB its HEX HOT 5
- node 18.0 - Discovering the gateway automatically fails HOT 5
- Update stable version in repo from 3.1.2 to 3.1.3 HOT 1
- Switching Lights in Groups / Rooms from Tradfri - State is "null" by True HOT 1
- Support for Ikea Dirigera HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iobroker.tradfri.