Page 1 of 1

Set Value in Level Control

Posted: 12 Feb 2017, 07:15
by FranckkyDoo
Is there a way to change the Value of level control via the Rules ?? I use the level control for my heater and I want to be able to change the Value with some Rules.

Re: Set Value in Level Control

Posted: 23 Mar 2017, 15:42
by mrwee
Did you find a solution for this? I'm thinking about something similar

Re: Set Value in Level Control

Posted: 24 Mar 2017, 02:56
by FranckkyDoo
No I don't find any solution yet. What is your idea?

Re: Set Value in Level Control

Posted: 25 Mar 2017, 03:38
by CoolWombat
Not sure if this might help, I've got an esp in my Hotspring spa which I've converted to be "WiFi" enabled. The esp also control the temperature of the spa. I had problem figuring out how to have a variable like set temperature and then do things like compare the water temperature and turning on the heater. What I ended up doing is to use a dummy device -

Device1
Device: Temperature - DS18b20
Name: DS18B20
Delay: 60
IDX/Var: 1
1st GPIO: GPIO-2
Send Data: Yes
Value Name 1: Temperature

Device4
Device: Dummy Device
Name: SetTemp
Delay: 60
IDX/Var: 4
Simulated Data Type: SENSOR_TYPE_QUAD
Send Data: Yes
Decimal Temperature: 1
Decimal Auto: 0
Decimal TempLow: 1
Decimal TempHigh: 1
Value Name 1: Temperature
Value Name 2: Auto
Value Name 3: TempLow
Value Name 4: TempHigh

"Temperature" is what I set the target temperature of my spa, "Auto" is to indicate if I want the esp to control the heater and "TempLow" & "TempHigh" is when to turn on and off the heater. I was going to have a couple of switches and also a display, but they haven't been implemented yet. Until then, I am sending the data across via OpenHAB.

Here's part of my rules -

on DS18B20#Temperature do
if [DS18B20#Temperature] > [SetTemp#TempHigh]
event,TurnOff
endif
endon

on DS18B20#Temperature do
if [DS18B20#Temperature] < [SetTemp#TempLow]
event,TurnOn
endif
endon

on TurnOn do
if [SetTemp#Auto] > 0
gpio,13,1
else
gpio,13,0
endif
endon

on TurnOff do
gpio,13,0
endif
endon

on SetTemperature do
TaskValueSet 4,1,%eventvalue%
TaskValueSet 4,3,%eventvalue%-0.5
TaskValueSet 4,4,%eventvalue%+0.6
endon

on SetAuto do
TaskValueSet 4,2,%eventvalue%
endon


To set the temperature you can either send via a standard http -

Example of setting the temperature to 37 degree -
http://192.168.1.xx/control?cmd=event,SetTemperature=37

Example of turning on auto -
http://192.168.1.xx/control?cmd=event,SetAuto=1

Or do it in OpenHAB rules -

sendHttpGetRequest("http://192.168.1.xx/control?cmd=event,SetTemperature=" + TargetTemperature)
where TargetTemperature is the value of the target temperature you want the spa set to

Hope that helps.

Cheers!

Re: Set Value in Level Control

Posted: 17 Aug 2018, 20:32
by ufumes
hi is there a way to make the variable assigned to TaskValueSet 4,2,%eventvalue% persist when the espeasyy if rebooted?