logger02 wrote:"AC_model" is to select the model of the heatpump becuase in the arduino I can use all heatpump
What happen if you print "otherdevices_idx[textDev]"? it's null or it's the value of idx that you have in the devices window.
I have some problems because the text sensor wasn't connected to the gateway. Try to update the text sensor through JSON:
http://YOUR_IP:YOUR_PORT/json.htm?type=command¶m=udevice&idx=IDX&nvalue=0&svalue=EXAMPLE_TEXT
you must to change YOUR_IP, YOUR_PORT, IDX and EXAMPLE_TEXT
How do I " print "otherdevices_idx[textDev]" "? (sorry, but I feel like a complete noob).
tried adding the line, unmodified, to the script right after " print(string.format('Mode: %s, fan: %s, temp: %s, modeCmd: %s', mode, fanSpeed, temperature, modeCmd))"
when I flip a switch this is the log:
So it would seem that the connection to the text device is working fine. also the message is sent properly, and I'm able to make the AC turn on/off. The coding is not working, but that's for another day
I'd just like to work out what is required to get rid of the "bad argument #1 to 'pairs' (table expected, got nil)" error that is cluttering my log file.
Turns out I should create a *.lua file in "DOMOTICZ_ROOT_FOLDER/scripts/lua" and not use the web interface to add it as an event.
Created script_device_heatpump.lua in above location, and the error message has disappeared from the log, and the devices are fully functional
Now I'm just waiting for an IR-receiver to arrive from China, and I can get started on decoding my Panasonic A75C3632 remote. Hopefully someone will then help me get it added to the Arduino sketch.
Hope to get some hints to finalize my IR remote.
To start with, I'm fairly new on arduino and I've built some sensors based on mysensors and I have a Domoticz controller running on raspberry pi.
I'm using the HeatPumpIR library and the lua script from Toni. The code running on the arduino has been slightly modified to support my IVT.
My problem seems to be that the IR signal is not transmitted from my arduino nano, even if debug message says everything is ok.
I've used the built in webcam of my laptop to verify nothing is transmitted from the IR LED. If I use the orignial remote I can see the IR light clearly in my webcam.
I'm using a TSAL4400 940nm LED from Aliexpress in series with a 1k ohm resistor connected to D3 and GND. I've tried 3 different LEDs from same batch.
What could possibly be the reason?
This is my serial monitor when starting up the sensor:
And When the command for Heatpump Mode Auto is sent from Domoticz this is the printout.
TSP:MSG:READ 0-0-2 s=17,c=1,t=2,pt=0,l=1,sg=0:1
TSP:MSG:ACK msg
TSP:MSG:SEND 2-2-0-0 s=17,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=ok:1
Requesting IR code from Domoticz...
TSP:MSG:SEND 2-2-0-0 s=16,c=2,t=47,pt=0,l=0,sg=0,ft=0,st=ok:
TSP:MSG:READ 0-0-2 s=16,c=2,t=47,pt=0,l=8,sg=0:00211114
IR code received from Domoticz...
Code: 0x00211114
IR code conversion OK: 0x211114
Model: ivt
Model #: 2
Power: 1
Mode: 1
Fan: 1
Temp: 20
All OK - sending IR command to heatpump...
TSP:MSG:SEND 2-2-0-0 s=17,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0
My bad...
I sorted the issue with IR LED not sending. I used an old sketch where IRSender was used instead of IRSenderPWM (probably in combination of updated libraries?)