I am adding a variable watch to my code generating program. I have added variables of my own to one of my security door sensors and then I poll the variables once a second to display status. It allows one to see the timers etc. in action. I don’t know the full impact of what I am doing. Under advance tab we have the options to add variables. A matching service goes with the variable. If I create a variable with a service that really doesn’t exist and then use it will it confuse any of the lower level processes?
I hope not because it really works well and eliminates the need for virtual devices.
Question 2
@guessed,
In my advanced tab there are variables such as TripPeriod which the wiki uses as a general purpose variable. How can we know what we can play with that the DSC code won’t change? I hope that makes sense!
Regards
Tim Alls
AllSeas Yachts
[quote=“TimAlls, post:1, topic:168376”]I am adding a variable watch to my code generating program. I have added variables of my own to one of my security door sensors and then I poll the variables once a second to display status. It allows one to see the timers etc. in action. I don’t know the full impact of what I am doing. Under advance tab we have the options to add variables. A matching service goes with the variable. If I create a variable with a service that really doesn’t exist and then use it will it confuse any of the lower level processes?
I hope not because it really works well and eliminates the need for virtual devices.[/quote]
Yes, variables within their own ServiceId’s are effectively “separate”, even if the Variable name is a duplicate (although, no guarantee’s that all Plugin code will be “robust” enough, it should be but ya never know)
Within a given device, there’s a “list” of the variables associated with it. This list is of the form:
(serviceId-1, variableName-1)
(serviceId-2, variableName-2)
…
(serviceId-n, variableName-n)
where uniqueness is guaranteed across the whole combo (serviceId-n, variableName-n)
They explicitly let you add your own for just the kinda of things you’re looking at.
Question 2 @guessed, In my advanced tab there are variables such as TripPeriod which the wiki uses as a general purpose variable. How can we know what we can play with that the DSC code won't change? I hope that makes sense! AllSeas YachtsYour question makes sense, but there's no clear definition of the "extensions" that various devices and/or Plugins use in terms of Service Variables. Generally speaking, a Device exposes variables from the composite of Services it implements.
Each of these services is supposed to be well defined, and have a “fixed” number of Variables. You can see these “fixed” definitions inside the various [tt]S_xxxxxx.xml[/tt] files.
Unfortunately, many devices (and MiOS itself) use additional variables that aren’t defined by the Service. MiOS does this a LOT, especially on the [tt]micasaverde-com HaDevice1[/tt] serviceId. In these cases, it’s hard to know what the intended purposes is. In some cases, setting one Variable might trigger another to get set also (I think this is where [tt]TripPeriod[/tt] is coming from, for example)
The safe bet, is to never write to a variable that you didn’t create, and always create any variables in a new/neutral serviceId.
@guessed,
That’s the info was looking for… Thanks
I have more bugs to work out but it is a relief that the direction I went is not going to cause problems.
Regards
Tim