@countjuh said in Daikin wifi controller options:
Can i get these variables out and translate them into my pimatic?
Yes. I think the easiest and most flexible tool is to use the pimatic-log-reader plugin. I have drafted an example for you which transforms three values (power status, operating mode, and target temperature) of the data set to pimatic attributes which can even be displayed in the devices view.
Here is the device config:
{
"file": "/home/pi/status.log",
"attributes": [
{
"name": "power",
"type": "boolean",
"acronym": "POW",
"discrete": true
},
{
"name": "mode",
"type": "string",
"acronym": "M",
"discrete": true
},
{
"name": "targetTemperature",
"type": "number",
"unit": "°C",
"acronym": "TT"
}
],
"lines": [
{
"match": ",pow=1",
"power": true
},
{
"match": ",pow=0",
"power": false
},
{
"match": ",mode=[017]",
"mode": "AUTO"
},
{
"match": ",mode=2",
"mode": "DEHUMDIFICATOR"
},
{
"match": ",mode=3",
"mode": "COLD"
},
{
"match": ",mode=4",
"mode": "HOT"
},
{
"match": ",mode=6",
"mode": "FAN"
},
{
"match": ",stemp=([\\d\\.]+)",
"targetTemperature": "$1"
}
],
"xAttributeOptions": [],
"id": "daikin",
"name": "Daikin Status",
"class": "LogWatcher"
}
],
The device can also be edited with device editor except for transformations to boolean attributes as the device editor expects a string value where true
or false
must be given. You may also notice an error message like "Invalid config of device "daikin": Property "#/lines/0/power" Should have type string, was: boolean in /lines/0/power, Property "#/lines/1/power" Should have type string, was: boolean in /lines/1/power"
. It is safe to ignore that for now.
For the result of the status command you need to append (use >>
operator) this to a log file, in the given example it is /home/pi/status.log
. As you probably do not want to fill up the log file with a long history of result data set you can keep short as follows:
# Call the following each time when a status command result is available
# The following line will truncate the log file or create it when it does not yet exist
truncate --size 0 /home/pi/status.log
# The following assumes the result of the status command has been stored in shell variable named RESULT
echo ${RESULT} >> /home/pi/status.log
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law