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


  • 0

Complicated Pond Script - calculate temperature


Question

Posted

Hi there,

 

i use three scripts for my pond control and need your help with this.

 

In first script, time for global variable will be calculated.

 

I got 4 values in my variable named "Teich": Day, Night, Winter and Stop. Time calculation for "Day" and "Night" is working but now i need mean value calucaltion from three water temperature sensors that are connected to a smart implant. ID´s for sensors are: 390, 391, 392

 

For this the variable "Winter" should be activated when water temperature is under 8 degress over 2 days.

If water is 8 degress or higher for 2 days, time based variables "Day" and "Night" should be working.

Note: When it is winter, day and night may not be active.

 

The fourth variable "Stop" should be triggered by toggle switch that sends central main event.

One klick should call "Stop", where "Stop" have to turn off all devices.

Another click should run script for "Day", "Night" and "Winter" again.

This is only for cleaning filter manually and turn off all connected pump. 

 

Here is my first Script for calculating "Day" and "Night":

Please login or register to see this code.

Script for central scene event is:

Please login or register to see this code.

Here I tried to set global variable "Stop", stop script #10 (see below) and call all devices to turn off.

 

Main script for connected devices is this one:

Please login or register to see this code.

For every step is asked device if it´s already turned on or off to get better debug and to prevent that always be sitched if not necessary.

 

I know that my scripts are not coded well. These are my first steps with LUA...

 

I hope that you can help me to program my scripts properly, to include the calculation of the temperature and I am grateful for your ideas and suggestions.

 

Benjamin

 

 

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

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

Guest
Answer this question...

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