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
Question
rvorsten 0
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.