@mwittig great! thank you! I will try it, when I’m home again!
-
[Implemented] plugin sispmctl update interval
-
@techbarney You’re welcome! Please note the
interval
is given is milliseconds."It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig I’m sorry, but at the moment it doesn’t work.
I have setup the config with “interval”: 10000, but it doesn’t recognize the changed state -
@techbarney said:
sorry, but at the moment it doesn’t work.
I have setup the config with “interval”: 10000, but it doesn’t recognize the changed statNote, the interval property must be provided as part of the device configuration!
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig my device configuration looks like:
{ "plugin": "sispmctl", "binary": "ssh admin@192.168.10.11 /share/MD0_DATA/.qpkg/Qnapware/opt/bin/sispmctl", "interval": 10000 },
Switching works perfect, but no change is noticed.
-
@techbarney said:
ssh admin@192.168.10.11 /share/MD0_DATA/.qpkg/Qnapware/opt/bin/sispmctl
Do you get some error message in the log like "SispmctlSwitch: unknown state= … "? As the plugin needs to read the output of the sispmctl command to get the state it may be that the ssh command creates some output causing an error.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig Switching is no problem and so i think that the binary should not be the problem, but I’m not sure… At the moment I get no error message.
When the NAS-Server was not reachable, I got a error message.
I was looking at the other plugins and was thinking about, what the @emit stands for?
-
@techbarney said:
Switching is no problem and so i think that the binary should not be the problem
Well, for switching, the plugin does not need to read the output of the command.
Please try to execute the following from the command line. The only thing you should get as output is 1 or 0.
ssh admin@192.168.10.11 /share/MD0_DATA/.qpkg/Qnapware/opt/bin/sispmctl -q -n -g 1 -d 0
EDIT:
I was looking at the other plugins and was thinking about, what the @emit stands for?
@emit is to trigger an event on the device instance. It is used to notify a state changes which will be processed by pimatic. The plugin uses the @_setState method implemented in the base class. This method will trigger the event also.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig so in the morning I take my old RasPi for testing this locally. So now I can use the default binary and everything works. After that I switch back to the QNAP-Server and everything works…
I think, I have to apologize. It was my bad in the config, interval in the wrong section… But thanks for all your help and coding! Sometimes it is better to sit down for a moment and think about the problem calmly -
@techbarney No worries. It’s great to hear it is working fine for you
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law