FlyingDiver wrote:The design intent is that only the plugin itself has write-access to it's own internal state. Which is a good thing, IMO.
Exactly. Chaos would undoubtedly ensue if you didn't restrict write access to critical state information. And adding some kind of security layer is quite large and, in all honesty, not something we're particularly interested in doing given the demand. We do, however, understand that there are situations where some separate communication layer (a la MQTT) is useful to add, and that inherently means the need for some way to connect them to the standard Indigo device types. In the past it's been up to the plugin developer to add that into the plugin that's built to use that comm layer. We're thinking about alternatives though (see next comment).
FlyingDiver wrote:What we need is either a rework of Virtual Devices or an alternative that uses some sort of inter-process API to manage the devices. Something that plugins and scripts can use, without having to do the variables and action groups. This "lighter weight" implementation is what I think of as a "shim". But I don't know if Jay and Matt agree.
The Virtual On/Off Device in the Virtual Devices Interface (the only one that applies really to this conversation) probably does need some work. The intention all along (notice the top "execution model" popup) was to have a variety of ways of using it. Action Groups and variables were the initial implementation - which for many cases is exactly what non-technical users needed (no scripts, etc) since it builds on the UI tools that they are already familiar with. I think that there's a "script" model, so that the various actions will just execute python scripts. I also now believe that automatic state management should be an option.
But for this particular use case, there may be yet another model: None (which doesn't really do anything at all except create a shell device). It might be that a script model that doesn't have any scripts associated with it might suffice as well. But in either case, there might (or might not) need to be actions added to directly modify properties/states. I've yet to hear why using the built-in indigo.device.turnOn(123) command wouldn't suffice to modify the devices
onOffState, but it's possible that there is a reason.
This needs more careful consideration to make sure that we're keeping the device simple, but also capable enough to solve this type of problem. We don't want to half-a$$ anything as most of you know - we're really quite deliberate when adding functionality to make sure that adhering to our KISS principle (as much as possible with an advanced product like Indigo).
We're having some side conversations about this, and feedback is welcome.