Maybe i’m overlooking the documentation.
But is there a way to get the available event options like sunset, time etc … via socket io ?
like:
socket.on('eventvariables', function(eventVariables){
console.log(eventVariables);
});
socket io event condition
Maybe i’m overlooking the documentation.
But is there a way to get the available event options like sunset, time etc … via socket io ?
like:
socket.on('eventvariables', function(eventVariables){
console.log(eventVariables);
});
@passie bump, nobody ?
@mwittig any idea?
@developer maybe?
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
I don’t think it is possible to pickup predicate events, but it is possible to pickup variable events.
One way of doing this is to listen for variable
and variableValueChanged
events and to filter the desired variable updates. In the given example there is a Sunrise
device with sunrise and sunset attributes. The variable
event listener is used to pickup the current values and the variableValueChanged
event listener is used to pickup subsequent updates which should happen once a day in the given example.
socket.on('variables', function(variables){
console.log("variables:", variables);
});
socket.on('variableValueChanged', function(data){
console.log("variableValueChanged:", data);
});
Output:
variables: [
{ name: 'Sunrise.sunrise',
readonly: true,
type: 'attribute',
value: '08:19:01',
unit: '' },
{ name: 'Sunrise.sunset',
readonly: true,
type: 'attribute',
value: '16:07:07',
unit: '' },
...
]
variableValueChanged: { variableName: 'solarview-inverter.gridVoltage',
variableValue: 228 }
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig Great thank you. !
@mwittig Just tried the code as explained above and it’s not exactly what i’m looking for. It only show’s devices and there state.
For instance Time isn’t a device while accessible from the Pimatic ui.
In the pimatic ui, where and how are the available events coming from ?
I’m correct this is coming from predicates.coffee ?
Hope there is a function to call these events.
@passie said in socket io event condition:
Just tried the code as explained above and it’s not exactly what i’m looking for. It only show’s devices and there state.
For instance Time isn’t a device while accessible from the Pimatic ui.
As said earlier I don’t think you can receive predicate events. To get an overview on which events are recieved and processed by the frontend see https://github.com/pimatic/pimatic-mobile-frontend/blob/master/app/connection.coffee
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
@mwittig said in socket io event condition:
As said earlier I don’t think you can receive predicate events. To get an overview on which events are recieved and processed by the frontend see https://github.com/pimatic/pimatic-mobile-frontend/blob/master/app/connection.coffee
oke thank you. I’ll have to find another way to get the event vars then.
For now I’ll use hardcoded ones, though this is of course not desired to be future proof.
any change they will be available in future releases via ex. socket.io ?