Page 1 of 1

problems saving a blocky script [Solved]

Posted: Wednesday 05 June 2019 22:33
by runskater
Hi,
I have a question regarding the usage of Blocky scripts. I have created a blocky scripting after creation I push the SAVE button but I have no idea where the script has been saved.
I have created a Switch which uses the script to send a notification. But when I activate this Switch nothing happens and I see the following error in de domoticz log:
Error script not found '/home/pi/domoticz/scripts/wim-komt-thuis'

So I wonder where the script has been saved. I am brand new to domoticz, so I did a lot of reading before starting to work with domoticz but I could not find an answer to this problem.
Hopefully anyone can help me with this problem.

Regards,
Runskater

Version: 4.10717
Platform: Raspi 3

Re: problems saving a blocky script

Posted: Wednesday 05 June 2019 23:10
by waaren
runskater wrote: Wednesday 05 June 2019 22:33 I have created a blocky scripting after creation I push the SAVE button but I have no idea where the script has been saved.
A Blockly script is stored in the domoticz database.
I have created a Switch which uses the script to send a notification. But when I activate this Switch nothing happens and I see the following error in de domoticz log: Error script not found '/home/pi/domoticz/scripts/wim-komt-thuis'
My understanding; from what I read in your post is that you try to trigger the script from the On Action field in the [edit] tab of the switch.
If my assumption is correct that I am afraid this will not work. The scripts referred to in the On Action field are external scripts.

If you have a problem with a script or a blockly than please include them in your post. For text based scripts between code </> tags and for Blockly as a screenshot.

Re: problems saving a blocky script

Posted: Thursday 06 June 2019 18:38
by runskater
Hello warren,

your assumption is right, I want to trigger the script from the On Action field
What I want is the following, just for learning to work with domoticz purposes:
- create a on/off switch, called 'iPhone-Wim'
- when I pushed on my iPhone the on/off switch from the Switch panel in domoticz I want to receive a notification and an email which tells me that the switch has been switched on or off.

Regards,
Willem

Re: problems saving a blocky script

Posted: Thursday 06 June 2019 21:47
by waaren
runskater wrote: Thursday 06 June 2019 18:38 I want to receive a notification and an email which tells me that the switch has been switched on or off.
Again that is not going to work with a Blockly script from the On Action field. But the good news is that it can be done with Blockly. Can you share a screenshot from the Blockly you created ?

Re: problems saving a blocky script

Posted: Friday 07 June 2019 21:38
by runskater
These are the screenshots of the 2 Blocky's that I have created.

Re: problems saving a blocky script

Posted: Saturday 08 June 2019 0:19
by waaren
runskater wrote: Friday 07 June 2019 21:38 These are the screenshots of the 2 Blocky's that I have created.
You seem to have missed to fill the subsystem blocks. If you press the down arrow in that block you will see the available subsystems. You need to configure these subsystems in the [setting] [notification] tab
blockly.png
blockly.png (63.4 KiB) Viewed 2632 times
And while your at it. Change the trigger to device and active to on before saving

Re: problems saving a blocky script

Posted: Sunday 09 June 2019 22:58
by runskater
I made the changes you suggested but unfortunately it still is not working for me. It might be that I misunderstand what you are saying regarding your saying: "And while your at it. Change the trigger to device and active to on before saving" I could not find that.

Let me explain what I have done:
-- created a dummy hardware, named it 'dummy'
- went into Switches and clicked on 'Manual light/switch"
selecterd hardware: selected the above created dummy hardware, named it: iPhone
Sselected witch type: On/Off
selected type: X10
House code: D
Unit code: 10
As: main device
See the attachment

Then I created the 2 events and selected the subsystem Pushover. This Pushover was created in Setings - Notifications. I am using the right User and Api key. I used the Test button to test the Pushover and the test was with positive result.
See the attachment

When I pushed the Switch then no Notifications is sent.
Message in the log : Status: User: Admin initiated a switch command (99/iPhone/On)
It looks look the Blocky's that I created is still not activated.

Re: problems saving a blocky script

Posted: Sunday 09 June 2019 23:47
by waaren
runskater wrote: Sunday 09 June 2019 22:58 -- created a dummy hardware, named it 'dummy'
OK
- went into Switches and clicked on 'Manual light/switch"
Look at the image below how to create dummy device and save active Blockly as device type. If you still don't receive the message then please double check if you applied your settings on the setup tab and set the priority of your message in the Blockly to a higher level.
Blocl;ly_2.png
Blocl;ly_2.png (165.64 KiB) Viewed 2610 times

Code: Select all

2019-06-09 23:57:08.663 Status: User: Admin initiated a switch command (1/iPhone/Off)
2019-06-09 23:57:10.904 (Dummy) Light/Switch (iPhone)
2019-06-09 23:57:10.907 EventSystem: Event triggered: Notify test_1
2019-06-09 23:57:10.770 Status: User: Admin initiated a switch command (1/iPhone/On)
2019-06-09 23:57:10.928 Status: Notification: Test subject
2019-06-09 23:57:11.932 Notification sent (pushover) => Success

Re: problems saving a blocky script

Posted: Monday 10 June 2019 11:21
by runskater
Thanks a lot for your assistance, it works now