Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Sprinkler Panel


pt13

Recommended Posts

So at the moment in order to + or - the water % or set delays in my sprinkler panel i need to go on to my computer, login and go to the panel etc........

 

Firstly, does anyone have a 'scene' solution to be able to set these parameters so that i can do it from my tablet/phone?

 

Secondly @Fibaro, it would be nice to have these parameters in the sprinkler panel on the tablet/phone.

Link to comment
Share on other sites

  • 1 year later...

Hey Sonny,

When debugging the button i get this response:

line 9: attempt to call field 'decode' (a nil value)

 

can someone help? i'm new to these types of things

 

@Sankotronic any chance you can help me out?

 

Link to comment
Share on other sites

Hey @Jamie mccrostie

 

Good call :)

 

- Set authentication

HC2 = Net.FHttp("192.168.1.162",80)

HC2:setBasicAuthentication("admin", "admin")

fibaro:debug('Button LUA Triggered: ')

-- get data table from the Sprinklers Panel

response ,status, errorCode = HC2:GET("/api/panels/drenchers")

jsonTable = json.decode(response)

fibaro:debug('Rain Delay Value: ' ..jsonTable.rainDelay);

-- change data in LUA for 0 hours delay

jsonTable.rainDelay = 0

fibaro:debug('Rain Delay New Value: ' ..jsonTable.rainDelay);

-- send updated table to panel

json = json.encode(jsonTable);

HC2:PUT("/api/panels/drenchers", json)

fibaro:log("ready")

fibaro:debug('Button LUA Finished: ')

 
Link to comment
Share on other sites

@amurray85 you need to put your hc ip address HC2=Net.FHttp("your HC ip address here",80) and then in the next line your username and password

if yourve upgraded since fibaro id it wont be ("admin","admin") any more thats why im asking what version software you have.

Edited by Jamie mccrostie
Link to comment
Share on other sites

yeah i worked that bit out.. any chance you can attempt creating the virtual device and see if you can replicate the error i'm seeing?

Link to comment
Share on other sites

Just now, amurray85 said:

yeah i worked that bit out.. any chance you can attempt creating the virtual device and see if you can replicate the error i'm seeing?

 

If you copy and paste the code you have altered not the original

Link to comment
Share on other sites

-- Set authentication
HC2 = Net.FHttp("192.168.1.13",80)
HC2:setBasicAuthentication("myusernamehere", "mypasswordhere")
fibaro:debug('Button LUA Triggered: ')

-- get data table from the Sprinklers Panel
response, status, errorCode = HC2:GET("/api/panels/drenchers")
jsonTable = json.decode(response)
fibaro:debug('Rain Delay Value: ' ..jsonTable.rainDelay);

-- change data in LUA for 0 hours delay
jsonTable.rainDelay = 0

fibaro:debug('Rain Delay New Value: ' ..jsonTable.rainDelay);

-- send updated table to panel
json = json.encode(jsonTable);
HC2:PUT("/api/panels/drenchers", json)
fibaro:log("ready")

fibaro:debug('Button LUA Finished: ')

Please login or register to see this link.

this is the guide i followed @Jamie mccrostie

Link to comment
Share on other sites

2 hours ago, amurray85 said:

-- Set authentication
HC2 = Net.FHttp("192.168.1.13",80)
HC2:setBasicAuthentication("myusernamehere", "mypasswordhere")
fibaro:debug('Button LUA Triggered: ')

-- get data table from the Sprinklers Panel
response, status, errorCode = HC2:GET("/api/panels/drenchers")
jsonTable = json.decode(response)
fibaro:debug('Rain Delay Value: ' ..jsonTable.rainDelay);

-- change data in LUA for 0 hours delay
jsonTable.rainDelay = 0

fibaro:debug('Rain Delay New Value: ' ..jsonTable.rainDelay);

-- send updated table to panel
json = json.encode(jsonTable);
HC2:PUT("/api/panels/drenchers", json)
fibaro:log("ready")

fibaro:debug('Button LUA Finished: ')

Please login or register to see this link.

this is the guide i followed @Jamie mccrostie

 

@amurray85

@Jamie mccrostie

 

..sorry just working from my phone so a bit limited in what I can do....

 

I had a quick look at the api and drencher still seems to be available so that's goes news...

 

Please login or register to see this attachment.

 

If you go to http://192.168.1.13/docs

 

Scroll down to panels and drenchers and select option ti get all drenchers .. 

That'll show you what's setup on your system

 

Second thing ..

you should try the Ip 127.0.0.0 port 1111 method to access the api

 

I can recall the syntax exactly but if you look at the code at  the start of my smart message hub scene you'll see it there  ( I use it to create variables)

 

Give that a whirl and I'll be at a computer later and can take a better look ..

 

-f

Edited by AutoFrank
Link to comment
Share on other sites

so lads, it appears as if the buttons still work even with the message in the debug.

I have a sneaking suspicion that its telling you that the value is now 0 even those its written the value.. 

 

Can someone confirm? i'm a bit of a programming n00b lol

 

Link to comment
Share on other sites

3 minutes ago, amurray85 said:

so lads, it appears as if the buttons still work even with the message in the debug.

I have a sneaking suspicion that its telling you that the value is now 0 even those its written the value.. 

 

Can someone confirm? i'm a bit of a programming n00b lol

 

So the buttons are changing rain delay in sprinkler panel? 

3 minutes ago, Jamie mccrostie said:

So the buttons are changing rain delay in sprinkler panel? 

 

Im not home so cant look, I recon its trying to change a value that doesnt exsist. AutoFranks on the case he will come thru when he gets home.

Link to comment
Share on other sites

7 minutes ago, amurray85 said:

thanks boys! love your work. this community is awesome.. lets hope this functionality gets built in

 

I take it that means its working then :mrgreen: good th hear

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...