Page 1 of 1

Blockly Events

Posted: 20 Jan 2018, 15:00
by LisaM
No matter how good they are, i'm unhappy with rules in ESPEasy. Rules are a compromise between extensibility and easy-of-use, making it neither.
I have implemented Scripts in uPyEasy (in Beta-1) and this wil give you full extensibility of uPyEasy firmware on the fly. There's no limitations what you can do to alter the behavior of uPyEasy, except off course the size of the Flash drive.
However it does require that you understand something about Python to make full use of it.

For those who don't want or can program Python, i'm thinking about another solution. I'm wondering if it is not better to use Blockly to program the events?
It would look something like this:
upyeasy blockly.JPG
upyeasy blockly.JPG (32.39 KiB) Viewed 28182 times
Please let me know what you think about Blockly or possible alternatives.

Re: Blockly Events

Posted: 20 Jan 2018, 15:48
by ManS-H
I don't have program skills so rules and blocky are a good alternative for me.

Re: Blockly Events

Posted: 20 Jan 2018, 20:34
by Domosapiens
Great Lisa !
Programming is soooo 1980 ;)

Re: Blockly Events

Posted: 20 Jan 2018, 22:56
by AndrewJ
Hi Lisa,
I'd not come across Blockly before but the ability to 'program' graphically is attractive. I don't know whether it would impose any limitations (memory etc, or more restricted functionality).
Hmmm, That's triggered another thought- I believe that NodeRED uses Python (presumably full python), wonder if it could be used sonehow. l don't know how "heavy" it is.
Anyway, worth exploring Blockly further.

Re: Blockly Events

Posted: 21 Jan 2018, 01:50
by LisaM
AndrewJ wrote: 20 Jan 2018, 22:56 Hi Lisa,
I'd not come across Blockly before but the ability to 'program' graphically is attractive. I don't know whether it would impose any limitations (memory etc, or more restricted functionality).
Hmmm, That's triggered another thought- I believe that NodeRED uses Python (presumably full python), wonder if it could be used sonehow. l don't know how "heavy" it is.
Anyway, worth exploring Blockly further.
Blocky is completely running on the client side, it's probably only feasible if the (javascript) library is stored locally on your own pc and only the result is loaded and saved to uPyEasy (similar to load/save settings). That way it won't take up valuable space in your SOC, while still benefiting from the GUI. Programming is mostly done from a single pc anyway, so this downside might be acceptable.
https://developers.google.com/blockly/guides/overview

Re: Blockly Events

Posted: 21 Jan 2018, 16:51
by AndrewJ
Ah, I realise now, it's not on the SOC. It does look interesting. Thanks for the link.

Re: Blockly Events

Posted: 27 Jan 2018, 19:24
by budman1758
+1

Re: Blockly Events

Posted: 28 Jan 2018, 14:55
by BertB
Well, it seems Rules no longer rulez.
No problem ... I have to go the python way anyway, but for getting things done quickly, Blockly is a nice alternative.

Having said that, one of the powerfull things in Rules is the handling of the output of the devices.

Re: Blockly Events

Posted: 28 Jan 2018, 17:28
by LisaM
BertB wrote: 28 Jan 2018, 14:55 Well, it seems Rules no longer rulez.
No problem ... I have to go the python way anyway, but for getting things done quickly, Blockly is a nice alternative.

Having said that, one of the powerfull things in Rules is the handling of the output of the devices.
Rules are still there, they are hidden by default just like in ESPEasy. Tools -> Switch on Rules checkbox and it's back!
Links to rules topic: viewtopic.php?f=23&t=4732

But... just like in ESPEasy, they are limited in functionality (they will grow a little bit until they have the same functionality as in ESPEasy.
Scripts are the full force, Blockly is more like rules. For all something to choose from.

Ps. Python is also used in ESPEasy, but only as supporting tool.

Re: Blockly Events

Posted: 01 Feb 2018, 03:51
by budman1758
As a non-programmer its ESPEasy that allowed me to be able to get anything done that I wanted to do. Rules may be limiting but they do allow folks like me to get things working. There are any number of firmwares and program languages out there but ESPEasy is the only one I have found that's actually EASY. Rules are limiting but they are about as complex as I can understand. I'm just and old half broke down heavy equipment mechanic\welder with enough electronics know how to bash some hardware together and make it work. I would hate to see ESPEasy fall by the wayside. I understand that at some point it will reach a plateau where it cannot be extended anymore. Just hope it gets there.

Having said all that I'm all for uPyEasy too. Mebbe this ole broke down welder can figger it out. :lol:

Just my 2 cents worth. :mrgreen:

Re: Blockly Events

Posted: 01 Feb 2018, 18:44
by LisaM
budman1758 wrote: 01 Feb 2018, 03:51 As a non-programmer its ESPEasy that allowed me to be able to get anything done that I wanted to do. Rules may be limiting but they do allow folks like me to get things working. There are any number of firmwares and program languages out there but ESPEasy is the only one I have found that's actually EASY. Rules are limiting but they are about as complex as I can understand. I'm just and old half broke down heavy equipment mechanic\welder with enough electronics know how to bash some hardware together and make it work. I would hate to see ESPEasy fall by the wayside. I understand that at some point it will reach a plateau where it cannot be extended anymore. Just hope it gets there.

Having said all that I'm all for uPyEasy too. Mebbe this ole broke down welder can figger it out. :lol:

Just my 2 cents worth. :mrgreen:
Rules are also present in uPyEasy now, viewtopic.php?f=23&t=4732, but... Blockly can do the same thing, graphically and distributed (meaning client-server).
If an 'old half broke down heavy equipment mechanic\welder with enough electronics' no longer can work with uPyEasy, i have failed. Extending it means more complex possibilities, not less easy ways of programming uPyEasy. ;)

Re: Blockly Events

Posted: 01 Feb 2018, 20:08
by budman1758
Blocky looks pretty cool. Looks like a bit of a chore to get it setup though.

Re: Blockly Events

Posted: 02 Feb 2018, 00:35
by LisaM
budman1758 wrote: 01 Feb 2018, 20:08 Blocky looks pretty cool. Looks like a bit of a chore to get it setup though.
It's a javascript library, no need for setup.

Re: Blockly Events

Posted: 02 Feb 2018, 10:05
by BertB
@Lisa
What exactly do you mean with client/server here?
Doe the blockly made script reside in, let's say, Domoticz and control functions from there in a upyEasy of does the upyEasy download the script and run it locally?

Re: Blockly Events

Posted: 02 Feb 2018, 11:46
by LisaM
BertB wrote: 02 Feb 2018, 10:05 @Lisa
What exactly do you mean with client/server here?
Doe the blockly made script reside in, let's say, Domoticz and control functions from there in a upyEasy of does the upyEasy download the script and run it locally?
It's a client-server based setup based on http communication:
- Client (browser on web, ios, android), containing the blockly library residing locally so the blockly library is NOT downloaded from uPyEasy
- Server (uPyEasy on SOC), containing the blockly 'rule' in XML. When editing the blockly rule, the xml is send from server to client and then stored again in uPyEasy for future editing. Or everything is done locally, blockly xml rule stored local, which is also possible. When everything is done locally, only the generated python rule is send to the server,
The blockly (xml based) rule has an option to generate python code from the blockly rule, this must be send to the server to run. The generated python code is identical to the current uPyEasy python based rules.

Re: Blockly Events

Posted: 03 Feb 2018, 11:43
by manjh
Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....

Re: Blockly Events

Posted: 03 Feb 2018, 13:00
by BertB
Must say, I feel a bit disconnected too.

Re: Blockly Events

Posted: 03 Feb 2018, 19:40
by LisaM
manjh wrote: 03 Feb 2018, 11:43
Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....
Assembler? OMG! :shock:
At work i've banned programming for about 80%!
We make models and computers are generating most efficient application code for us (with certified quality and traceability). No need for programming, unless it is something quite special (which doesn't happen a lot). Work is shifting towards the real intelligent work: how does the application need to function? Logical thinking instead of typing in code.

Re: Blockly Events

Posted: 03 Feb 2018, 21:54
by manjh
LisaM wrote: 03 Feb 2018, 19:40
manjh wrote: 03 Feb 2018, 11:43
Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....
Assembler? OMG! :shock:
At work i've banned programming for about 80%!
We make models and computers are generating most efficient application code for us (with certified quality and traceability). No need for programming, unless it is something quite special (which doesn't happen a lot). Work is shifting towards the real intelligent work: how does the application need to function? Logical thinking instead of typing in code.
Sure, keep dreaming. How do you think the compilers were built? Or even the firmware? Treasure what you have today, but donot deny what lies at the base...

Re: Blockly Events

Posted: 04 Feb 2018, 00:39
by BertB
LisaM wrote: 03 Feb 2018, 19:40
manjh wrote: 03 Feb 2018, 11:43
Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....
Assembler? OMG! :shock:
At work i've banned programming for about 80%!
We make models and computers are generating most efficient application code for us (with certified quality and traceability). No need for programming, unless it is something quite special (which doesn't happen a lot). Work is shifting towards the real intelligent work: how does the application need to function? Logical thinking instead of typing in code.
Wonder why so many programs are so unlogical and often need so many hotfixes ...
😀
But okay, i am a bit of a Dinosaur.

Re: Blockly Events

Posted: 05 Feb 2018, 09:38
by TD-er
manjh wrote: 03 Feb 2018, 21:54 [...]
Sure, keep dreaming. How do you think the compilers were built? Or even the firmware? Treasure what you have today, but donot deny what lies at the base...
True that there is still need for those kind of programming techniques and people to maintain them.
But the fact is that such knowledge is quite a specialism and often too complicated for most.
And if it is done right, abstraction will help people making less mistakes and achieve results with less work.

I've been programming in C++ a lot, but still find it a real burden sometimes to see how much effort it takes to do a simple task.
Working with ESPeasy makes me appreciate the -sometimes bloated- libraries available at my daytime job ;) and still allow me to get to the bottom of detailed bit-banging and old fashioned memory management.

Re: Blockly Events

Posted: 05 Feb 2018, 10:24
by manjh
I fully agree. The key is: use the proper technique for the job.
in most cases, using methods like Blockly is OK.

But when programming for the ISS (the Space Station, that is!) or one of the new medical operation robots, let's make sure we understand the code all the way down to the last bit...
Can you imagine an astronaut (during a spacewalk) or a surgeon (while doing open-heart surgery) reading on the screen: "unknown error. Please reboot." ... :-(

Having said that, I still maintain my original statement about having lots of fun when writing Assembler code...
Also, I think we should end this discussion as it is very much off-topic... :-)