Not sure how to implement what I need Blockly or LUA or something else?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
paul402
Posts: 105
Joined: Monday 23 May 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Not sure how to implement what I need Blockly or LUA or something else?

Post by paul402 »

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.
SweetPants

Re: Not sure how to implement what I need Blockly or LUA or something else?

Post by SweetPants »

Did you take a look at the new Python plugin system? viewforum.php?f=65
paul402
Posts: 105
Joined: Monday 23 May 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Not sure how to implement what I need Blockly or LUA or something else?

Post by paul402 »

Thanks for that hint!
I think that it might be the right way to go as the changes to my code would be minimal then.
paul402
Posts: 105
Joined: Monday 23 May 2016 23:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Not sure how to implement what I need Blockly or LUA or something else?

Post by paul402 »

Yes! I got a basic version of my Python program running in an hour or two from some Dummy switches for testing.
Now to reconfigure it to take advantage of Domoticz.
Thanks again.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest