Rules do not work properly on new versions

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Rules do not work properly on new versions

#1 Post by kimot » 03 Nov 2018, 21:21

Hi
I am using ESPEsy for one year without any problems like floor heating thermostat.
You can see it here:
https://www.youtube.com/watch?v=1ef6tRinOQ4
Today I try upgrade one thermostat with newest ESPeasy "mega-20181101"
My previous "stable" version was "v2.0.0-dev13"

I have got two problems:

First:
Node do not receive some Domoticz http call:
I call every minute this from LUA script - for node with newest fw. 192.168.1.102
( only part of code )

Code: Select all

   local HDO_PV = domoticz.devices('HDO-PV')
		    -- Kacka
		    local urlHDO = 'http://192.168.1.102/control?cmd=event,HDO='..(HDO_PV.nValue)..'' 
		    print(urlHDO)
		    domoticz.openURL(urlHDO)
		    -- Filip
		    local urlHDO = 'http://192.168.1.105/control?cmd=event,HDO='..(HDO_PV.nValue)..'' 
		    print(urlHDO)
		    domoticz.openURL(urlHDO)
		  
	        -- Kacka
	        local setpoint = domoticz.devices('Kacka_Setpoint')
            local url= 'http://192.168.1.102/control?cmd=event,HeatSetpoint='..(setpoint.state)..''
            print(url)
            domoticz.openURL(url)
            local mode = domoticz.devices('Kacka_Control')
            local url2= 'http://192.168.1.102/control?cmd=event,modeSet='..(mode.level)..''
            print(url2)
            domoticz.openURL(url2)
             -- Filip
	        local setpoint = domoticz.devices('Filip_Setpoint')
            local url= 'http://192.168.1.105/control?cmd=event,HeatSetpoint='..(setpoint.state)..''
            print(url)
            domoticz.openURL(url)
            local mode = domoticz.devices('Filip_Control')
            local url2= 'http://192.168.1.105/control?cmd=event,modeSet='..(mode.level)..''
            print(url2)
            domoticz.openURL(url2)
I receive HDO and modeSet, but not HeatSetpoint.

This script is called every minute.
But if I change set point in Domoticz and send new value immediately, it is received without problem:

Code: Select all

 local url= 'http://192.168.1.102/control?cmd=event,HeatSetpoint='..(device.state)..''
            print(url)
            domoticz.openURL(url)
It seems thet Setpoinf setting is missed if sends immediately after previous HDO value
or immediately before modeSet

Second:
My relay is never switch on with new version of firmware.

My complete rules:

Code: Select all

On System#Boot do     // init values for safety
 gpio,5,0    		// relay off
 TaskValueSet,2,2,10    // setpoint to 10 deg. C
 TaskValueSet,2,3,0      // variable "Hetating" to 0
 TaskValueSet,2,4,0     //  mode of control 0 = "off"
 TaskValueSet,5,2,0    // HDO = 0 , it means heating is not allowed
 timerSet,1,60               // next timer set interval
endon

on ModeSet do      // receive mode of controll from domoticz
 TaskValueSet 2,4,%eventvalue%  //0 - off,   10   room temperature control,  20 floor temp. control
endon    
 
on HeatSetpoint do      // from Domoticz setpoint receive
 TaskValueSet 2,2,%eventvalue%
  if [Variables#Setpoint]>32    // fot safety greater than 32 deg. C not allowed
   TaskValueSet,2,2,32
  endif  
endon

on HDO do              // from Domoticz HDO value receiving
 TaskValueSet 5,2,%eventvalue%   // if HDO=0 heatinfg is not allowed
endon

On FloorControl do               // variable "Heating" setting for floor controlled temperature setting
 if [Floor#Temperature]<[Variables#Setpoint]
  TaskValueSet,2,3,1                 // if floor temp lower than setpoint - "Hetating"= 1
 endif
endon

On RoomControl do      // variable "Heating" setting for room controlled temperature setting
 if [Room#Temperature]<[Variables#Setpoint]      // if room temp lower than setpoint - "Hetating"= 1
  TaskValueSet,2,3,1 
 endif
endon

on HeatingOn do                                               
 if [Rele#Switch]=0                                                          //   if heating was off, switch it on
  TaskValueSet,2,1,[Variables#Counter]+1      //   increment switch counter
 endif
 gpio,5,1                                                                               // switch relay on
 SendToHTTP 192.168.1.253,8080,/json.htm?type=command&param=switchlight&idx=26&switchcmd=On                   //and send switch status to Domoticz 
 SendToHTTP 192.168.1.253,8080,/json.htm?type=command&param=udevice&idx=28&nvalue=0&svalue=660;0       // end watts consumption to Domoticz ( 660W )
endon

on HeatingOff do            // switch relay off and send switch status to Domoticz end watts consumption to Domoticz ( 0 watts )
 gpio,5,0
 SendToHTTP 192.168.1.253,8080,/json.htm?type=command&param=switchlight&idx=26&switchcmd=Off
 SendToHTTP 192.168.1.253,8080,/json.htm?type=command&param=udevice&idx=28&nvalue=0&svalue=0;0
endon

On Relay do                                     // distinguish if set relay or not according variable "Heating"
 if [Variables#Heating]=1
  event,HeatingOn                     // switch relay on and send info to Domoticz
 else
  event,HeatingOff                   // switch relay off and send info to Domoticz
 endif
endon   

On Rules#Timer=1 do     // main "loop" called every 60 sec.
 TaskValueSet,2,3,0          // initially set "Heating" to 0 meaning heating off 
 if [Variables#Mode]=20   // if we control floor temperature call FloorControl where set variable "Heating"
  event,FloorControl
 endif
 if [Variables#Mode]=10  // if we control room temperature call RoomControl where set variable "Heating"
  event,RoomControl
 endif
 if  [Variables#Mode]=0    // if heating is off set "Heating" variable to 0
  TaskValueSet,2,3,0
 endif   
 if [Floor#Temperature]>32   // if floor temp. greater than 32  set "Heating" to 0  ( for safety )
   TaskValueSet,2,3,0
 endif
  if [Floor#Temperature]<10   // if floor temp. lower then 10 set "Heating" to 0 ( for safety - DS18B20 error )
  TaskValueSet,2,3,0   
 endif
 if [Var#HDO]=0                  // if HDO=0 ( not time allowed for heating ) set "Heating" to 0
   TaskValueSet,2,3,0
 endif
 event,Relay                // call event relay - switch relay according "Heating" variable
 timerSet,1,60         // set next interval
endon
Debug log:

Code: Select all

21050233: EVENT: Rules#Timer=1
21050283: ACT : TaskValueSet,2,3,0
21050311: Lev.1: [if 20=20]=true
21050313: ACT : event,FloorControl
21050343: Lev.1: [if 20=10]=false
21050364: Lev.1: [if 20=0]=false
21050392: Lev.1: [if 16.31>32]=false
21050445: Lev.1: [if 16.31<10]=false
21050452: Lev.1: [if =0]=false
21050458: ACT : event,Relay
21050470: ACT : timerSet,1,60
21050484: EVENT: Rules#Timer=1 Processing time:251 milliSeconds
21050492: Command: taskvalueset
21050494: Command: event
21050495: EVENT: FloorControl
21050552: Lev.1: [if 16.31<21.5]=true
21050554: ACT : TaskValueSet,2,3,1
21050601: EVENT: FloorControl Processing time:107 milliSeconds
21050655: Command: event
21050655: EVENT: Relay
21050718: Lev.1: [if 0=1]=false
21050721: Lev.1: [else]=true
21050723: ACT : event,HeatingOff
21050751: EVENT: Relay Processing time:96 milliSeconds
21050759: Command: timerset
21050760: Command: taskvalueset
21050764: Command: event
21050765: EVENT: HeatingOff
21050858: ACT : SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=udevice&idx=28&nvalue=0&svalue=0;0
21050888: EVENT: HeatingOff Processing time:123 milliSeconds
21050896: Command: sendtohttp
21050897: SendToHTTP: Host: 192.168.1.253 port: 8080
21050897: SendToHTTP: Path: /json.htm?type=command¶m=switchlight&idx=26&switchcmd=Off
21050902: GET /json.htm?type=command¶m=switchlight&idx=26&switchcmd=Off HTTP/1.1^^Host: 192.168.1.253:8080^^User-Agent: ESP Easy/2010
21050902: GET /json.htm?type=command¶m=switchlight&idx=26&switchcmd=Off HTTP/1.1^^Host: 192.168.1.253:8080^^User-Agent: ESP Easy/2010
21050904: HTTP : Command_HTTP_SendToHTTP closing connection
21050907: Command: sendtohttp
21050908: SendToHTTP: Host: 192.168.1.253 port: 8080
21050908: SendToHTTP: Path: /json.htm?type=command¶m=udevice&idx=28&nvalue=0&svalue=0;0
21050915: GET /json.htm?type=command¶m=udevice&idx=28&nvalue=0&svalue=0;0 HTTP/1.1^^Host: 192.168.1.253:8080^^User-Agent: ESP Easy/20
21050915: GET /json.htm?type=command¶m=udevice&idx=28&nvalue=0&svalue=0;0 HTTP/1.1^^Host: 192.168.1.253:8080^^User-Agent: ESP Easy/20
21050916: HTTP : Command_HTTP_SendToHTTP closing connection
21061724: EVENT: Variables#Setpoint=21.50 Processing time:60 milliSeconds
21061725: EVENT: Variables#Heating=1.00
21061783: EVENT: Variables#Heating=1.00 Processing time:58 milliSeconds
21061784: EVENT: Variables#Mode=20.00
21061843: EVENT: Variables#Mode=20.00 Processing time:59 milliSeconds
My devices - you can see "Heating" is 1, but relay is still off:
Image
Attachments
2018-11-03-201203_1920x1080_scrot.png
2018-11-03-201203_1920x1080_scrot.png (149.93 KiB) Viewed 1743 times

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Rules do not work properly on new versions

#2 Post by grovkillen » 03 Nov 2018, 23:41

A lot has happened since your last update and how rules are being processed is one of those things. We're working on getting it back on track but still some kinks are not fixed. What made you update the node? What was missing in the earlier release? (Not that I say that you shouldn't update but you should try new releases on test hardware before placing it in "production")
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 67 guests