Not sure how to implement what I need Blockly or LUA or something else?
Posted: Monday 24 April 2017 10:24
I wrote a system in Python and PiFace to control my house including the shutters, radio, lighting and it works ok but I would like to integrate the functionality into the flexibility of Domoticz.
I am using Piface to control the shutters in my program. I have successfully integrated PiFace into Domoticz but not yet written any code apart from testing.
In my Python program I have used a matrix with the following structure.
Shutter#, time1, time2, sunrise-sunset-offset, up/down, stopafter,firedtoday
Shutter number is my device#
Time1 is the exact time to trigger if there is no time2
Time2 >0 invokes a time trigger range between time1 and time2 based on sunset/sunrise plus/minus any offset.
Sunrise-sunset-offset is a trigger offset + or – in minutes from sunset or sunrise when time time2 is >0. Only used with time2.
Up/down is obvious
Stopafter is the number of seconds after switching the shutter motor that a stop signal is sent. This allows the shutters to be partially open/closed for privacy.
All the data for each device is in the matrix and once a minute I run through the matrix to check for triggers.
I have programmed Blockly to switch an PiFace output at a specific time and understand how it works.
My Python program works great and reliably BUT I just cannot get my head around converting it into Blockly or LUA.
I’m not asking anyone to program this for me, but just to point me in the right direction or just tell me what I am missing.
Could I/should I recreate my matrix somehow or should I use a linear list of events in Blockly or something else….
Sorry for the long post.
I am using Piface to control the shutters in my program. I have successfully integrated PiFace into Domoticz but not yet written any code apart from testing.
In my Python program I have used a matrix with the following structure.
Shutter#, time1, time2, sunrise-sunset-offset, up/down, stopafter,firedtoday
Shutter number is my device#
Time1 is the exact time to trigger if there is no time2
Time2 >0 invokes a time trigger range between time1 and time2 based on sunset/sunrise plus/minus any offset.
Sunrise-sunset-offset is a trigger offset + or – in minutes from sunset or sunrise when time time2 is >0. Only used with time2.
Up/down is obvious
Stopafter is the number of seconds after switching the shutter motor that a stop signal is sent. This allows the shutters to be partially open/closed for privacy.
All the data for each device is in the matrix and once a minute I run through the matrix to check for triggers.
I have programmed Blockly to switch an PiFace output at a specific time and understand how it works.
My Python program works great and reliably BUT I just cannot get my head around converting it into Blockly or LUA.
I’m not asking anyone to program this for me, but just to point me in the right direction or just tell me what I am missing.
Could I/should I recreate my matrix somehow or should I use a linear list of events in Blockly or something else….
Sorry for the long post.