Raspberry Pi 4 4gb
openhabian 1.7
openhab 3.4.4
Hi to everyone,
I’ve written a rules with blockly to control my 2x lamps (upstairs and corridor) with 3x QuadWallmote from Aeotec.
The rule goes for some times… and from 2 days it enter in an infinite loop that full all the CPU.
Result I must reboot the system…
Here the code:
if (itemRegistry.getItem('Node_011_WallMote_Quad_PT_Salotto_Scene_Number').getState() == '1.0' && itemRegistry.getItem('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1').getState() == 'OFF') {
events.sendCommand('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1', 'ON');
} else if (itemRegistry.getItem('Node_011_WallMote_Quad_PT_Salotto_Scene_Number').getState() == '1.0' && itemRegistry.getItem('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1').getState() == 'ON') {
events.sendCommand('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1', 'OFF');
}
if (itemRegistry.getItem('Node_011_WallMote_Quad_PT_Salotto_Scene_Number').getState() == '2.0' && itemRegistry.getItem('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1').getState() == 'OFF') {
events.sendCommand('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1', 'ON');
} else if (itemRegistry.getItem('Node_011_WallMote_Quad_PT_Salotto_Scene_Number').getState() == '2.0' && itemRegistry.getItem('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1').getState() == 'ON') {
events.sendCommand('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1', 'OFF');
}
if (itemRegistry.getItem('ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number').getState() == '1.0' && itemRegistry.getItem('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1').getState() == 'OFF') {
events.sendCommand('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1', 'ON');
} else if (itemRegistry.getItem('ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number').getState() == '1.0' && itemRegistry.getItem('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1').getState() == 'ON') {
events.sendCommand('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1', 'OFF');
}
if (itemRegistry.getItem('ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number').getState() == '2.0' && itemRegistry.getItem('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1').getState() == 'OFF') {
events.sendCommand('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1', 'ON');
} else if (itemRegistry.getItem('ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number').getState() == '2.0' && itemRegistry.getItem('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1').getState() == 'ON') {
events.sendCommand('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1', 'OFF');
}
if (itemRegistry.getItem('ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number').getState() == '1.0' && itemRegistry.getItem('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1').getState() == 'OFF') {
events.sendCommand('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1', 'ON');
} else if (itemRegistry.getItem('ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number').getState() == '1.0' && itemRegistry.getItem('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1').getState() == 'ON') {
events.sendCommand('ZWaveNode003FGS224FibaroDoubleSmartModule_Switch1', 'OFF');
}
// Quando il tasto N13 viene premuto, verifica lo
// stato dello switch al 1P e commuta di conseguenza
if (itemRegistry.getItem('ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number').getState() == '2.0' && itemRegistry.getItem('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1').getState() == 'OFF') {
events.sendCommand('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1', 'ON');
} else if (itemRegistry.getItem('ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number').getState() == '2.0' && itemRegistry.getItem('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1').getState() == 'ON') {
events.sendCommand('ZWaveNode009FGS224FibaroDoubleSmartModule_Switch1', 'OFF');
}
events.sendCommand('Node_011_WallMote_Quad_PT_Salotto_Scene_Number', '6.0');
events.sendCommand('ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number', '6.0');
events.sendCommand('ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number', '6.0');
the blockly rules “simply” check if the light is “on” or “off” and check the scene (number from 1.0 to 4.0) from the Wallmotes.
After that if is On then off, and if is Off then On.
that for 2x Switch and 3x Wallmotes.
After All, I change the Scene number to 6.0 to not have problems in another Run of the rule.
But, because there always a “but”… this is the result from the front tail:
2023-11-14 20:53:15.844 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘Node_011_WallMote_Quad_PT_Salotto_Scene_Number’ predicted to become 6.0
2023-11-14 20:53:15.849 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number’ received command 6.0
2023-11-14 20:53:15.851 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number’ received command 6.0
2023-11-14 20:53:15.852 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number’ predicted to become 6.0
2023-11-14 20:53:15.857 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘Node_011_WallMote_Quad_PT_Salotto_Scene_Number’ received command 6.0
2023-11-14 20:53:15.858 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number’ predicted to become 6.0
2023-11-14 20:53:15.862 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number’ received command 6.0
2023-11-14 20:53:15.864 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number’ received command 6.0
2023-11-14 20:53:15.866 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘Node_011_WallMote_Quad_PT_Salotto_Scene_Number’ received command 6.0
2023-11-14 20:53:15.869 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number’ received command 6.0
2023-11-14 20:53:15.871 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number’ received command 6.0
2023-11-14 20:53:15.872 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘Node_011_WallMote_Quad_PT_Salotto_Scene_Number’ received command 6.0
2023-11-14 20:53:15.878 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number’ received command 6.0
2023-11-14 20:53:15.880 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number’ received command 6.0
2023-11-14 20:53:15.880 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘Node_011_WallMote_Quad_PT_Salotto_Scene_Number’ predicted to become 6.0
2023-11-14 20:53:15.883 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘Node_011_WallMote_Quad_PT_Salotto_Scene_Number’ received command 6.0
2023-11-14 20:53:15.885 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number’ received command 6.0
2023-11-14 20:53:15.886 [INFO ] [openhab.event.ItemCommandEvent ] - Item ‘ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number’ received command 6.0
2023-11-14 20:53:15.886 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ZWave_Node_012_WallMote_Quad_PT_Entrata_Scene_Number’ predicted to become 6.0
2023-11-14 20:53:15.888 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item ‘ZWave_Node_013_WallMote_Quad_1P_Corridoio_Scene_Number’ predicted to become 6.0
Some One as an Explanation?
thank you a lot.
bye
Xander