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

Temperature alarm LUA sample?


rvorsten
 Share

Question

I want to program an alarm system for my heater, and am seekingsome LUA guidance.

I have:

- One central heater device, controlled by a basic Fibaro switch

- One door/window temperature sensor near it, measuring temperature in the heater room

I noticed a situation where my switch "hung". According to HC2 it was off, but the physical contact was still closed ('ON'). I had to ON and OFF it once again, manually for it to really go off. This should never happen, but it did, and resulted in my heater almost exploding...

Simply put, I want to detect a temperature increase while the heater control device is off. So code should be something like:

variable "previous_room_temp"

variable "current_room_temp"

current_room_temp = read_temp(door_window_sensor) /* what's the temperature? */

if ((current_room_temp > previous_room_temp) AND heater = OFF) /* did it heat up while heater is off? */

then

send_alarm("dude, check your heater switch!") /* Help! */

end

previous_room_temp = current_room_temp /* store new temperature for future reference */

Are there any LUA guru's who can point me into the right direction by providing code to:

- read the exact temperature from a door/window sensor

- store this temperature in a global variable

Thanks,

Ronald

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Guest Lode

When your heater doesn't shut down by itself when max temperature has been reached i would NEVER use something like this.

I've been reading this a couple of times from some other users but i don't understand the problem.

When my heater has reached the max temperature (set by user) it shuts down, it doesn't matter if my thermostat keeps asking for more. It's the build in sensor from your heater that should handle this.

Link to comment
Share on other sites

  • 0
  • Inquirer
  • When your heater doesn't shut down by itself when max temperature has been reached i would NEVER use something like this.

    I've been reading this a couple of times from some other users but i don't understand the problem.

    When my heater has reached the max temperature (set by user) it shuts down, it doesn't matter if my thermostat keeps asking for more. It's the build in sensor from your heater that should handle this.

    Sure Lode. I do agree. I have a pretty modern heater which I'm sure will shut of itself in case of overheating. However, even just for the sake of energy saving - it's a software effort 'only' to detect, alarm and an automated attempt to fix.

    Making progress with the LUA code here now. Fascinating that no-one seems to have something like this built yet!

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

     Share

    ×
    ×
    • Create New...