Modify the RHVAC code to be sent by an IR Tuya with Tasmota


#1

Hello guys, I need your help to try to assemble a piston. The idea would be through the command of a virtual thermostat to be able to modify the RHVAC code to be sent by an IR Tuya with Tasmota.
The code is this one below. I can’t find the solution to this problem, so I wanted to ask for help to solve this

Please if anyone can help


IR Blaster Post Request
#2

It looks like you have some bad “” check around “SwingV”:"Off,

I assume you are trying to send json string? the -1 also do not look like strings


#3

Good catch on the missing quotes, @E_Sch:+1:
(both lines 33 & 42)


Upon closer examination, I notice that some of OP’s double quotes have been converted to “smart-quotes”… (as seen in this closeup snippet)

pic

  • The green arrows point to the standard “straight” quotes. (my recommendation)
  • The red arrows point to the “slanted” quotes. (which I try to avoid)

Note: There are many more variations in your code, but I just wanted to zoom in so you could see more clearly. (there’s at least 7 culprits on line 33, and at least 7 on line 42)


Pro Tip:

If you are editing on Windows, then Ctrl-Plus a few times can enlarge the webpage, to make it easier to distinguish between the two quotes. (Afterwards, Ctrl-0 will reset the webpage to the default size)


#4

Thank you very much.
Here goes the piston with the corrections.
Do you think you would need to modify anything else?
This CTemp string would be a variable modified by the temperature of the thermostat.
I was wanting to do something similar with these variables
“Power” :

On
Off
"Mode" :
Off
Auto
Cool
Heat
Dry
Fan
"FanSpeed" :
Auto
Min
Low
Med
High
Max
"SwingV" : vertical swing of Fan
Auto
Off
"SwingH" : horizontal swing of Fan
Auto
Off
Wide
"Celsius" :
On
Off
"Temp" :
Range 16-31
"Quiet" :
On
Off
Quiet mode ( "On" / "Off" )
"Turbo" :
On
Off
Turbo mode ( "On" / "Off" )
"Econo" :
On
Off
"Light" :
On
Off
"Filter" :
On
Off
"Clean" :
On
Off
"Beep" :
On
Off
"Sleep" :
Timer in seconds

#5

This one requires testing. Preferably with Trace turned on, and Log Level set to Full.


#6

It is not working properly.
It sends the code but always with the same temperature, 17 degrees,
I need the temperature to vary according to the temperature I set on the thermostat.
Example: if I put 17 degrees in the thermostat, 17 degrees would be sent in the code; if I put 20 that would send 20

14/10/2020 20:09:46 +577ms

+3ms ╔Received event [Ar Quarto].thermostatMode = off with a delay of 62ms, canQueue: true, calledMyself: false
+33ms ║RunTime initialize > 32 LockT > 1ms > rtDT > 1ms > pistonT > 0ms (first state access 30 4 28)
+37ms ║Runtime (12741 bytes) successfully initialized in 1ms (v0.3.110.20200916_HE)
+39ms ║╔Execution stage started
+44ms ║║Condition #36 evaluated false (3ms)
+48ms ║║Condition #43 evaluated false (3ms)
+52ms ║║Condition #69 evaluated false (3ms)
+55ms ║║Comparison (enum) off changes_to (string) cool = false (1ms)
+57ms ║║Condition #71 evaluated false (4ms)
+58ms ║║Condition group #1 evaluated false (state did not change) (17ms)
+65ms ║║Comparison (enum) off changes_to (string) off = true (2ms)
+67ms ║║Cancelling condition #33's schedules...
+68ms ║║Condition #33 evaluated true (7ms)
+69ms ║║Cancelling condition #32's schedules...
+71ms ║║Condition group #32 evaluated true (state changed) (10ms)
+74ms ║║Cancelling statement #53's schedules...
+90ms ║║Calculating (integer)0 - (integer)1 >> (integer)-1
+129ms ║║Calculating (integer)0 - (integer)1 >> (integer)-1
+131ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+133ms ║║Calculating (string)Vendor : (string)COOLIX >> (string)
+135ms ║║Calculating (string) , (string)Model >> (string)Model
+137ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+139ms ║║Calculating (string)Model : (integer)-1 >> (string)
+141ms ║║Calculating (string) , (string)Power >> (string)Power
+143ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+145ms ║║Calculating (string)Power : (string)Off >> (string)
+147ms ║║Calculating (string) , (string)Mode >> (string)Mode
+149ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+151ms ║║Calculating (string)Mode : (string)Off >> (string)
+153ms ║║Calculating (string) , (string)Celsius >> (string)Celsius
+155ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+157ms ║║Calculating (string)Celsius : (string)On >> (string)
+159ms ║║Calculating (string) , (string)Temp >> (string)Temp
+161ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+163ms ║║Calculating (string)Temp : (decimal)0 >> (string)
+164ms ║║Calculating (string) , (string)FanSpeed >> (string)FanSpeed
+166ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+168ms ║║Calculating (string)FanSpeed : (string)UNKNOWN >> (string)
+170ms ║║Calculating (string) , (string)SwingV >> (string)SwingV
+172ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+174ms ║║Calculating (string)SwingV : (string)Off >> (string)
+175ms ║║Calculating (string) , (string)SwingH >> (string)SwingH
+177ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+179ms ║║Calculating (string)SwingH : (string)Off >> (string)
+181ms ║║Calculating (string) , (string)Quiet >> (string)Quiet
+183ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+185ms ║║Calculating (string)Quiet : (string)Off >> (string)
+186ms ║║Calculating (string) , (string)Turbo >> (string)Turbo
+188ms ║║Invalid ternary operator. Ternary operator's syntax is (condition ? trueValue:falseValue ). Please check your syntax and try again.
+190ms ║║Calculating (string)Turbo : (string)Off >> (string)

Clear

Full

#7

To really understand the log, we’d need to see the green snapshot with Trace turned on.


Educated guess:
The errors are all from line 42


Strange… There is no reference to 17 anywhere in that log…


#8

* deleted duplicate pics to reduce confusion *


#9

Three times I changed the temperature of the thermostat but each time I got the same result in the code, 17 degrees celsius

{“IrReceived”:{“Protocol”:“COOLIX”,“Bits”:24,“Data”:“0xB2BF00”,“DataLSB”:“0x4DFD00”,“Repeat”:0,“IRHVAC”:{“Vendor”:“COOLIX”,“Model”:-1,“Power”:“On”,“Mode”:“Cool”,“Celsius”:“On”,“Temp”:17,“FanSpeed”:“Auto”,“SwingV”:“Off”,“SwingH”:“Off”,“Quiet”:“Off”,“Turbo”:“Off”,“Econo”:“Off”,“Light”:“Off”,“Filter”:“Off”,“Clean”:“Off”,“Beep”:“Off”,“Sleep”:-1}}}

22:28:10 RUL: IRRECEIVED#DATA performs “WebSend [192.168.86.244:39500] /?json={“IrReceived”:{“Data”:“0XB2BF00”}}”

22:28:10 SRC: Rule

“IrReceived”:{“Protocol”:“COOLIX”,“Bits”:24,“Data”:“0xB2BF00”,“DataLSB”:“0x4DFD00”,“Repeat”:0,“IRHVAC”:{“Vendor”:“COOLIX”,“Model”:-1,“Power”:“On”,“Mode”:“Cool”,“Celsius”:“On”,“Temp”:17,“FanSpeed”:“Auto”,“SwingV”:“Off”,“SwingH”:“Off”,“Quiet”:“Off”,“Turbo”:“Off”,“Econo”:“Off”,“Light”:“Off”,“Filter”:“Off”,“Clean”:“Off”,“Beep”:“Off”,“Sleep”:-1}}}

22:28:16 RUL: IRRECEIVED#DATA performs “WebSend [192.168.86.244:39500] /?json={“IrReceived”:{“Data”:“0XB2BF00”}}”

“IrReceived”:{“Protocol”:“COOLIX”,“Bits”:24,“Data”:“0xB2BF00”,“DataLSB”:“0x4DFD00”,“Repeat”:0,“IRHVAC”:{“Vendor”:“COOLIX”,“Model”:-1,“Power”:“On”,“Mode”:“Cool”,“Celsius”:“On”,“Temp”:17,“FanSpeed”:“Auto”,“SwingV”:“Off”,“SwingH”:“Off”,“Quiet”:“Off”,“Turbo”:“Off”,“Econo”:“Off”,“Light”:“Off”,“Filter”:“Off”,“Clean”:“Off”,“Beep”:“Off”,“Sleep”:-1}}}

22:29:00 RUL: IRRECEIVED#DATA performs “WebSend [192.168.86.244:39500] /?json={“IrReceived”:{“Data”:“0XB2BF00”}}”

22:29:00 SRC: Rule


#10

“IrReceived”:{“Protocol”:“COOLIX”,“Bits”:24,“Data”:“0xB2BF00”,“DataLSB”:“0x4DFD00”,“Repeat”:0,“IRHVAC”:{“Vendor”:“COOLIX”,“Model”:-1,“Power”:“On”,“Mode”:“Cool”,“Celsius”:“On”,“Temp”:17,“FanSpeed”:“Auto”,“SwingV”:“Off”,“SwingH”:“Off”,“Quiet”:“Off”,“Turbo”:“Off”,“Econo”:“Off”,“Light”:“Off”,“Filter”:“Off”,“Clean”:“Off”,“Beep”:“Off”,“Sleep”:-1}}}
22:36:44 RUL: IRRECEIVED#DATA performs “WebSend [192.168.86.244:39500] /?json={“IrReceived”:{“Data”:“0XB2BF00”}}”


{“IrReceived”:{“Protocol”:“COOLIX”,“Bits”:24,“Data”:“0xB2BF00”,“DataLSB”:“0x4DFD00”,“Repeat”:0,“IRHVAC”:{“Vendor”:“COOLIX”,“Model”:-1,“Power”:“On”,“Mode”:“Cool”,“Celsius”:“On”,“Temp”:17,“FanSpeed”:“Auto”,“SwingV”:“Off”,“SwingH”:“Off”,“Quiet”:“Off”,“Turbo”:“Off”,“Econo”:“Off”,“Light”:“Off”,“Filter”:“Off”,“Clean”:“Off”,“Beep”:“Off”,“Sleep”:-1}}}
22:37:31 RUL: IRRECEIVED#DATA performs “WebSend [192.168.86.244:39500] /?json={“IrReceived”:{“Data”:“0XB2BF00”}}”


#11

Can you post a Full log of this happening? I want to see webCoRE processing the data.


#12

I discovered the error but I am unable to find the solution.
I was sending the 17 degree date every time. In this case, I have to do the control via RHVAC only. However I am not able to solve the code.



#13

It may also be helpful if you breakdown the full logic flow so others can better understand what you are trying to do.

Here is how I understand your goals:

  • You manually adjust a virtual thermostat (Ar Quarto)
  • webCoRE sees the change, and a piston runs
  • webCoRE sends a command to IR Tuya Quarto Connect (Is this your MQTT server?)
  • The server processes the command, and sends out a IR signal to your RHVAC

Is this the flow you are trying to accomplish?


#14

Here it go. Thanks for your considerations.
Yes, It’s my MQTTT server. I’m using UFO-R1 with Tasmota-IR.bin

This code is working on the console, but when i go to the webcore is not working, i have that message
IRhvac {“Vendor”:“COOLIX”, “Power”:“On”,“Mode”:“Cool”,“FanSpeed”:3,“Temp”:23}

Tentei de todas as maneiras abaixo




#15

Thanks, but I am still waiting on an answer and a full log that matches the latest piston.


#16

I would like to thank you very much for your help @WCmore
I ended up trying to rethink everything about the piston, and I came up with a solution that works


Now I’m having the temperature control correctly.
I am thinking on a way to incorporate the other commands in the piston now, like ventilation speed and hot or cold mode in the code