My first script momentry swicth

Hi

 

I want to create 2 scripts one that simulates a momentry switch for example when a bsc command to turn hah relay 1 on the script would then wait 500 millisecond and turn hah relay 1 off making it a momenty switch.

Script 2 take a bsc input and then turn another end point on for example hah input 1 turns on the script would read this and turn on hah relay 2 on, hah input 1 turns off the script would then turn hah relay 2 off.

 

Member for

15 years 7 months

garrydwilms

14 years 9 months ago

John.

Check out the demo scripts already on your HAH. I am sure the examples include scripts to do exactly what you need.

See bindrelaysapplet.lua and relay1autooffapplet.lua

If your still struggling I am sure all of us in here will give you the requested code but as these scripts are so basic I think it would be beneficial for your learning to give these a go yourself.

Scripts in the following folder: /etc_ro_fs/plugboard/samples. Let us know how you get on. Garry

Member for

15 years 10 months

jprior4

14 years 8 months ago

Hi Garry

Thanks for the pointer in the right direction, I have had a look at the example scripts, but they seem to be in V1 script engine syntax and according to the plugboard page THIS IS DEPRECATED AS OF HAH BUILD 280 USE V2 SCRIPT ENGINE? Do they still work?

Cheers
John

Member for

15 years 7 months

garrydwilms

14 years 8 months ago

On my device the location described above has v2 scripts in it. Note the /etc_ro_fs directory NOT /etc Can you recheck and confirm? Also what version you running? Thanks Garry

Member for

15 years 10 months

jprior4

14 years 8 months ago

Hi Gary

I am away from the HAH at the moment but I am sure I looked in /etc not /etc_ro_fs so I bet this is my problem. I think my version is 304 or 300 something.

 

Cheers
John