Hi @jkandasa
Sorry for not posting the feedback yet...
But yes - It works like a charm. And the timestamp solution seems to do what its supposed to
Hi @jkandasa
Sorry for not posting the feedback yet...
But yes - It works like a charm. And the timestamp solution seems to do what its supposed to
Hi @jkandasa
Sorry for not posting the feedback yet...
But yes - It works like a charm. And the timestamp solution seems to do what its supposed to
@jkandasa
Thanks.. Will give it a go..
Is it also correct that the //Update Fan Speed should use
if (fanSpeed == 'Auto')
and not:
if (mode == 'Auto')
and so on...?
No worries @jkandasa
I'm trying to create the needed sensors. I assume I'll have to create some additional "dummy" sensors on the AC node.
Is it possible to create a custom "Multi selector" sensor?
The existing HVAC ones doesn't quite match the settings on my unit.
Regarding the script itself - would it not need some logic to prevent it from sending the value if nothing has changed?
I added the script on the "Utilities > Scripts tab" - created an "Execute Script" operation on the "Resources > Operations" tab, and finally a simple timer, running every 15 seconds, operating the "operation".
If the script doesn't check for changes and stop if none has happened, I suspect that I will hear a most annoying beep from the heatpump four times every minute
I won't mind, but I'm sure I will shortly be single again....
UPDATE
It works as I feared
Tried just doing "Text" sensors for holding the variables, and the code picks them up (except for fan speed), and sends them to the heatpump faithfully every time the script runs...
Mildly annoying
Also, I think I should change from "simple" to "cron" for the timer. However it won't accept my cron entry "*/4 * * * * *" trying to make it run every 15 seconds...
Hi @jkandasa
I don't want to put any pressure on you or anything like that - I'm very grateful for all your hard work that has gone into this project - which ROCKS btw
But - was my above info useful, or was it insufficient to explain the issue?
Not very helpful I know - but I had the same problem (local install but still...)
Started to write a long post for the forum, and then suddenly noticed that the web page had refreshed and everything was running smoothly.
Seems first start can take quite a while. At least on an old first gen. RPi
Sure @jkandasa
The LUA script that Toni wrote looks like this:
-- These are the configuration variables, set them according to your system
modelCmd = '0' -- Panasonic CKP, see https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/examples/HeatpumpIRController/HeatpumpIRController.ino#L68
textDev = 'IR data' -- Name of the 'IR data' MySensors device
irSendDev = 'IR send' -- Name of the 'IR send' MySensors device
commandArray = {}
for key, value in pairs(devicechanged) do
if (key == 'Heatpump Mode' or key == 'Heatpump Fan Speed' or key == 'Heatpump Temperature') then
mode = otherdevices['Heatpump Mode']
fanSpeed = otherdevices['Heatpump Fan Speed']
temperature = math.floor(otherdevices_svalues['Heatpump Temperature'])
if (mode == 'Off') then powerModeCmd = '00'
elseif (mode == 'Auto') then powerModeCmd = '11'
elseif (mode == 'Heat') then powerModeCmd = '12'
elseif (mode == 'Cool') then powerModeCmd = '13'
elseif (mode == 'Dry') then powerModeCmd = '14'
elseif (mode == 'Fan') then powerModeCmd = '15'
elseif (mode == 'Maint') then powerModeCmd = '16'
end
if (fanSpeed == 'Auto') then fanSpeedCmd = '0'
elseif (fanSpeed == 'Fan 1') then fanSpeedCmd = '1'
elseif (fanSpeed == 'Fan 2') then fanSpeedCmd = '2'
elseif (fanSpeed == 'Fan 3') then fanSpeedCmd = '3'
elseif (fanSpeed == 'Fan 4') then fanSpeedCmd = '4'
elseif (fanSpeed == 'Fan 5') then fanSpeedCmd = '5'
end
temperatureCmd = string.format("%02x", temperature)
modeCmd = '00' .. modelCmd .. powerModeCmd .. fanSpeedCmd .. temperatureCmd
print(string.format('Mode: %s, fan: %s, temp: %s, modeCmd: %s', mode, fanSpeed, temperature, modeCmd))
commandArray['UpdateDevice'] = otherdevices_idx[textDev] .. '|0|' .. modeCmd
commandArray['IR send'] = 'On'
end
end
return commandArray
The code will generate an eight digit code looking something like this:
12345678
Position 1+2: Always "00", double zero
Position 3: Model code - in my case "4" - refers to Arduino sketch
Position 4+5: Power mode - for example "11" - Auto mode
Position 6: Fan speed - for example "3" - speed 3
Position 7+8: Temperature in hex - for example "18" - 24 degrees
Above would result in the string: 00411318 - Auto mode, Fan speed 3, 24 degrees
The mode, fanSpeed and temperature variables defined in the first section refers to the dummy devices that were needed on Domoticz
Hi.
I've just moved from Domoticz to MC, and so far I'm a happy chappy
On domo I was controlling my heatpump/AC unit using Toni's setup, slightly altered to allow for my Panasonic inverter.
I used his LUA script to calculate the needed codes to send to the AC.
Now I'm trying to make the thing work on MC...
I can send fixed commands, using the RAW feature, but I'm stuck trying to figure out a smart way of doing it on MC.
Somehow I need to make the state of "Heatpump Mode (including ON/OFF)", "Fan Speed" and "Temperature Setting" work together to generate an eight digit code that will be send to the AC node when one of the parameters update.
Any pointers (or solutions )
Thanks