help with panasonic cloud

Python and python framework

Moderator: leecollings

Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

huston we have a problem.

the first one
error .JPG
error .JPG (133.64 KiB) Viewed 1226 times
The second one
i think i been blocked by panasonic cloud
i cannot login anymore in the app.
After i login and try to communicate with the app i got a connection error
check your wlan adapter
This in on the 2 devices.
I'm sure i got a connection ,if i look into my mirotik is see a correct ip adres and can ping my 2 devices.
If i start the script manualy it's works ,no error but on node red is see this.
error1.JPG
error1.JPG (19.86 KiB) Viewed 1226 times
if i ask the status manual of my device i got this
gianni@homecontrol:~/panasonic$ python3 pcomfortcloud.py login pasword get 1
reading from device 'Living' (id number)
{'message': 'Adapter Communication error', 'code': 5005}
gianni@homecontrol:~/panasonic$
grts gianni
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

Hi, @Gianni,

Problems are there to solve them. :D

pcomfortcloud.py No such file or directory.

The panasonic2mqtt.sh file contains:

Code: Select all

python3 pcomfortcloud.py login pasword get 1 | /<path_to_mosquitto_pub/mosquitto_pub --url mqtt://127.0.0.1 -t panasonic/living -l
It cannot find the path of pcomfortcloud.py and so we have to insert this.

So it will become:

/<path_to_python3/python3 pcomfortcloud.py login pasword get 1 | /<path_to_mosquitto_pub/mosquitto_pub --url mqtt://127.0.0.1 -t panasonic/living -s[/code]

Code: Select all

/path_to_python3/python3 /home/gianni/panasonic/pcomfortcloud.py login pasword get 1 | /path_to_mosquitto_pub/mosquitto_pub --url mqtt://127.0.0.1/panasonic/living -l
You should check your path to python3 and insert it. Also the path for mosquitto_pub.
I have as a place holder inserted path_to_python3, resp path_to_mosquitto_pub

The unknown key name 'StartLimitIntervalSec' is obviously unknown in Ubuntu. You can delete it from the panasonic2mqtt.service file.

AdapterCommunicationerror is at the Panasonic side.
Do we request to often?

Do you use this adapter: http://www.panasonic.hk/usm.ashx/e/7zt1 ... maunal.pdf

If so, try to disconnect and start up again.
I hope you will manage to get the communication back.

Regards
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

i fixed the service

Code: Select all

python3.8 /home/gianni/panasonic/pcomfortcloud.py login pasword get 1 | mosquitto_pub --url mqtt://127.0.0.1/panasonic/living -l;
Now it's running
It's looks like the script is runnnig fine and the problems were on the panasonic cloud site.

grts Gianni
Last edited by Gianni on Thursday 21 May 2020 20:36, edited 1 time in total.
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

Hi,

@Gianni,

Fortunately the system is running. I was convinced that it could not be caused by the script, unless the Pansonic does not like to be queried every minute.
After youy closed the process with CTRL-C, I assume, the process could not be started again.

The reason was that the directory, where the pcomfortcloud.py has been installed in the directory /home/gianni/panasonic.
This directory is not in your path and therefore you have to use the full path, as I wrote.

The reason that it worked before was, that the process was started from /home/gianni/panasonic with the command ./panasonic2mqtt.sh
As I did not know where the python3 and mosquitto_pub have been installed, I suggested therefore also to use the full path, but obviously they are in the path. So a modification is not necessary.

So may we conclude that the service is running? Including start/stop? And is enabled so that we a publish (for the moment) every minute?

You start the process with the command python3.8. I don't think that that is needed.
You can easy check with the command
python3 -V
If it indicates 3.8 something you can start it normal with python3.
Now it's running
It's looks like the script is runnnig fine and the problems were on the panasonic cloud site.
Is the script running fine, but does the service also run?

I continue now with node red flow.

Regards
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

FireWizard wrote: Thursday 21 May 2020 21:29

Is the script running fine, but does the service also run?

I continue now with node red flow.

Regards
if i reboot everything works fine,node red is accessible and i see the flow output :-)
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

HI,

@Gianni,

If the panasonic2mqtt runs fine as a service we can leave that part and concentrate on Node Red.

Can you try this flow:

Code: Select all

[{"id":"895546b7.2d10c","type":"mqtt in","z":"5bae5c9d.cc469c","name":"MQTT In","topic":"panasonic/#","qos":"2","datatype":"auto","broker":"c2d9657a.d81bf8","x":160,"y":320,"wires":[["969fd0fc.91ae2"]]},{"id":"ccb5a50f.4461e8","type":"string","z":"5bae5c9d.cc469c","name":"Strip","methods":[{"name":"strip","params":[{"type":"str","value":" "}]},{"name":"split","params":[{"type":"str","value":":"},{"type":"num","value":"2"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":590,"y":320,"wires":[["7f7c8cad.7614fc"]]},{"id":"7f7c8cad.7614fc","type":"function","z":"5bae5c9d.cc469c","name":"To Domoticz","func":"if (msg.topic == \"panasonic/living\"){ \n\nswitch (msg.payload[0]) {\n\n    case \"temperatureInside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":8,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n    \n    case \"temperatureOutside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":9,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;  \n    \n    case \"temperature\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":10,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n}\n}\n\nif (msg.topic == \"panasonic/slaapkamer\"){ \n\nswitch (msg.payload[0]) {\n\n    case \"temperatureInside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":18,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n    \n    case \"temperatureOutside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":19,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;  \n    \n    case \"temperature\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":20,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n}\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":320,"wires":[["9fb89083.61ba9","44626582.97812c"]]},{"id":"9fb89083.61ba9","type":"debug","z":"5bae5c9d.cc469c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":340,"wires":[]},{"id":"44626582.97812c","type":"mqtt out","z":"5bae5c9d.cc469c","name":"Domoticz In","topic":"domoticz/in","qos":"0","retain":"false","broker":"c2d9657a.d81bf8","x":970,"y":280,"wires":[]},{"id":"969fd0fc.91ae2","type":"filter","z":"5bae5c9d.cc469c","name":"Filter unrelevant msg","property":"payload","propertyType":"msg","asArray":false,"itemProperty":"","itemPropertyType":"item","rules":[{"t":"cont","v":"readingfromdevice","vt":"str","output":2},{"t":"eq","v":"id","vt":"str","output":2},{"t":"cont","v":"parameters","vt":"str","output":2},{"t":"else","output":1}],"checkall":"true","outputs":2,"x":400,"y":320,"wires":[["ccb5a50f.4461e8"],[]]},{"id":"c2d9657a.d81bf8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Open the function node and adjust the IDX for yours and what you want to test.

As said I have (as a test) created 3 device for TemperatureInside, TemperatureOutside and Temperature setting.
This are 2 virtual Temperature sensors and 1 thermostat setpoint.

I have now created 6 sensors, 3 for the living and 3 for the slaapkamer.
Test it

I assume that the TemperatureOutside for both are identical, so maybe one outside temperature sensor is enough.

Awaiting the result.

My last post tonight

Regards
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

thx again

Temp inside and outside works perfect

if old temp is 20° and is set is to 24° when the script run again setpoint value is back to 20°
setpoint is not set new temp but i think we need to reverse the flow to set.
Me Happy for now with the results :-)

mvg Gianni
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

Hi,

@Gianni

You are running too fast. :D

We do all the information from the panasonic script to Domoticz first.
That means that you cannot control the airco from Domoticz.

You should see, if you have configured, 4 temperatures under the Temperature tab.

For both devices, living and slaapkamer, the outside and inside temperature.
Under the Utility tab you will find 2 thermostat setpoints.

You can try to change the setpoint in another way, e.g. with your app. That should become visible on the thermostat setpoint.

That is all, what has been programmed so far.

Regards
Last edited by FireWizard on Friday 22 May 2020 11:34, edited 1 time in total.
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

Heheheehe i know but im happy that we are allready so far.
I got now 3 temp sensor and 2 setpoints working.
I only set 1 temp outside.

Grts gianni
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

Good evening @Gianni,

I have been working at your flow.

I think, you should (or maybe you did already) create the following virtual sensors. (This is for the "Living")

1. Temperature sensor: for Temperature Inside will appear under Temperature tab
2. Temperature sensor: for Temperature Outside will appear under Temperature tab
3. Thermostat Setpoint: for Temperature will appear under Utility tab
4. Switch: for Power will appear under Switches tab
5. Selector Switch: for Fanspeed will appear under Switches tab
6. Selector Switch: for Mode will appear under Switches tab
7. Selector Switch: for Eco will appear under Switches tab
8. Selector Switch: for Air swing Vertical will appear under Switches tab
9. Selector Switch: for Air Swing Horizontal will appear under Switches tab

The Selector Switches you have to edit, so click "Edit" for each Selector Switch and fill in the various items.

If you are finished, it should look like (but they are grey):

Screenshot_Panasonic4.png
Screenshot_Panasonic4.png (257.01 KiB) Viewed 1162 times
Note down all your IDX numbers!!!

Repeat this for your "slaapkamer". Do it also for the Outside temperature.
You can later configure it as "unused".

If you have finished the previous thing, copy the flow below to your Node Red.

And open the function node, called "To Domoticz" and adjust the IDX's according to your Domoticz configuration.

Code: Select all

[{"id":"895546b7.2d10c","type":"mqtt in","z":"5bae5c9d.cc469c","name":"MQTT In","topic":"panasonic/#","qos":"2","datatype":"auto","broker":"c2d9657a.d81bf8","x":160,"y":539,"wires":[["969fd0fc.91ae2"]]},{"id":"ccb5a50f.4461e8","type":"string","z":"5bae5c9d.cc469c","name":"Strip","methods":[{"name":"strip","params":[{"type":"str","value":" "}]},{"name":"split","params":[{"type":"str","value":":"},{"type":"num","value":"2"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":590,"y":539,"wires":[["7f7c8cad.7614fc"]]},{"id":"7f7c8cad.7614fc","type":"function","z":"5bae5c9d.cc469c","name":"To Domoticz","func":"if (msg.topic == \"panasonic/living\"){ \n\nswitch (msg.payload[0]) {\n\n    case \"temperatureInside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":8,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n    \n    case \"temperatureOutside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":9,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;  \n    \n    case \"temperature\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":10,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n    \n    case \"power\":\n    msg.payload = {\"command\":\"switchlight\", \"idx\": 11, \"switchcmd\": msg.payload[1]};\n    break;\n    \n    case \"fanSpeed\":\n\n        switch (msg.payload[1]) {\n            \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Low\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"LowMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Mid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"HighMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n            case \"High\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"60\"};\n            break;\n\n        }\n    break;\n    \n    case \"mode\":\n        \n        switch (msg.payload[1]) {\n            \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Cool\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"Dry\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Heat\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"Fan\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n        }\n    break;\n    \n    case \"eco\":\n        \n        switch (msg.payload[1]) {\n    \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":14,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Quiet\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":14,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"Powerful\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":14,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n            \n        }\n    break;\n    \n    case \"airSwingVertical\":\n        \n        switch (msg.payload[1]) {\n\n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Down\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"DownMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Mid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"UpMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n            case \"Up\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"60\"};\n            break;\n\n        }\n    break;\n    \n    case \"airSwingHorizontal\":\n        \n        switch (msg.payload[1]) {\n\n            \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Left\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"LeftMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Mid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"RightMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n            case \"Right\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"60\"};\n            break;\n\n        }\n    break;\n    \n}\n}\n\nif (msg.topic == \"panasonic/slaapkamer\"){ \n\nswitch (msg.payload[0]) {\n\n    case \"temperatureInside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":8,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n    \n    case \"temperatureOutside\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":9,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;  \n    \n    case \"temperature\":\n    msg.payload = {\"command\":\"udevice\",\"idx\":10,\"nvalue\":0,\"svalue\":msg.payload[1]};\n    break;\n    \n    case \"power\":\n    msg.payload = {\"command\":\"switchlight\", \"idx\": 11, \"switchcmd\": msg.payload[1]};\n    break;\n    \n    case \"fanSpeed\":\n\n        switch (msg.payload[1]) {\n            \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Low\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"LowMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Mid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"HighMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n            case \"High\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":12,\"nvalue\":1,\"svalue\":\"60\"};\n            break;\n\n        }\n    break;\n    \n    case \"mode\":\n        \n        switch (msg.payload[1]) {\n            \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Cool\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"Dry\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Heat\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"Fan\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":13,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n        }\n    break;\n    \n    case \"eco\":\n        \n        switch (msg.payload[1]) {\n    \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":14,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Quiet\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":14,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"Powerful\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":14,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n            \n        }\n    break;\n    \n    case \"airSwingVertical\":\n        \n        switch (msg.payload[1]) {\n\n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Down\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"DownMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Mid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"UpMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n            case \"Up\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":15,\"nvalue\":1,\"svalue\":\"60\"};\n            break;\n\n        }\n    break;\n    \n    case \"airSwingHorizontal\":\n        \n        switch (msg.payload[1]) {\n\n            \n            case \"Auto\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"10\"};\n            break;\n            \n            case \"Left\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"20\"};\n            break;\n\n            case \"LeftMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"30\"};\n            break;\n\n            case \"Mid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"40\"};\n            break;\n            \n            case \"RightMid\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"50\"};\n            break;\n\n            case \"Right\":\n            msg.payload = {\"command\":\"udevice\",\"idx\":16,\"nvalue\":1,\"svalue\":\"60\"};\n            break;\n\n        }\n    break;\n    \n}\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":539,"wires":[["9fb89083.61ba9","44626582.97812c"]]},{"id":"9fb89083.61ba9","type":"debug","z":"5bae5c9d.cc469c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":559,"wires":[]},{"id":"44626582.97812c","type":"mqtt out","z":"5bae5c9d.cc469c","name":"Domoticz In","topic":"domoticz/in","qos":"0","retain":"false","broker":"c2d9657a.d81bf8","x":970,"y":499,"wires":[]},{"id":"969fd0fc.91ae2","type":"filter","z":"5bae5c9d.cc469c","name":"Filter unrelevant msg","property":"payload","propertyType":"msg","asArray":false,"itemProperty":"","itemPropertyType":"item","rules":[{"t":"cont","v":"readingfromdevice","vt":"str","output":2},{"t":"eq","v":"id","vt":"str","output":2},{"t":"cont","v":"parameters","vt":"str","output":2},{"t":"else","output":1}],"checkall":"true","outputs":2,"x":400,"y":539,"wires":[["ccb5a50f.4461e8"],[]]},{"id":"c2d9657a.d81bf8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Now it is time to test and test and test, but remember this flow is ONLY the data from the pcomfortcloud.py script to Domoticz.
Actions, which will control your airco will follow if you have confirmed that it works as expected.
If you want things changed, you can try, but please report back.

Regards
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

Good evening FireWizard

I configured everything like you asked me.
Everything works except its just 1 step wrong.

I will try to explain with the eco mode
I have to change the Svalue from script in node red to

Code: Select all

    case "eco":
        
        switch (msg.payload[1]) {
    
            case "Auto":
            msg.payload = {"command":"udevice","idx":161,"nvalue":1,"svalue":"0"};
            break;
            
            case "Quiet":
            msg.payload = {"command":"udevice","idx":161,"nvalue":1,"svalue":"10"};
            break;

            case "Powerful":
            msg.payload = {"command":"udevice","idx":161,"nvalue":1,"svalue":"20"};
            break;
            
        }
Because if i set it like 10/20/30 then the auto function show as Quiet, quiet as powerful and powerfull like undefined.

This is the same for all selectors.
If i change them to 0/10/20 in the script then the gui is correct in domoticz
test.JPG
test.JPG (33.08 KiB) Viewed 1155 times
Mvg Gianni
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

HI,

@Gianni,

Strange
I suppressed the 0 (Off)

Screenshot_Panasonic5.png
Screenshot_Panasonic5.png (157.92 KiB) Viewed 1154 times

Can you show me the contents of the debug node connected beside the MQTT out?

It is my first time I configured this with Selector Switches.
So I want to learn as well,

Regards
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

ok then this is my fault
Bacause there is no off on the selectors i started auto with 0
Now i changed all the values on the node started with 0 and now all the selectors are correct.
test1.JPG
test1.JPG (178.91 KiB) Viewed 1153 times
the script is like this now

Code: Select all

if (msg.topic == "panasonic/living"){ 

switch (msg.payload[0]) {

    case "temperatureInside":
    msg.payload = {"command":"udevice","idx":138,"nvalue":0,"svalue":msg.payload[1]};
    break;
    
    case "temperatureOutside":
    msg.payload = {"command":"udevice","idx":137,"nvalue":0,"svalue":msg.payload[1]};
    break;  
    
    case "temperature":
    msg.payload = {"command":"udevice","idx":139,"nvalue":0,"svalue":msg.payload[1]};
    break;
    
    case "power":
    msg.payload = {"command":"switchlight", "idx": 140, "switchcmd": msg.payload[1]};
    break;
    
    case "fanSpeed":

        switch (msg.payload[1]) {
            
            case "Auto":
            msg.payload = {"command":"udevice","idx":157,"nvalue":1,"svalue":"0"};
            break;
            
            case "Low":
            msg.payload = {"command":"udevice","idx":157,"nvalue":1,"svalue":"10"};
            break;

            case "LowMid":
            msg.payload = {"command":"udevice","idx":157,"nvalue":1,"svalue":"20"};
            break;

            case "Mid":
            msg.payload = {"command":"udevice","idx":157,"nvalue":1,"svalue":"30"};
            break;
            
            case "HighMid":
            msg.payload = {"command":"udevice","idx":157,"nvalue":1,"svalue":"40"};
            break;

            case "High":
            msg.payload = {"command":"udevice","idx":157,"nvalue":1,"svalue":"50"};
            break;

        }
    break;
    
    case "mode":
        
        switch (msg.payload[1]) {
            
            case "Auto":
            msg.payload = {"command":"udevice","idx":159,"nvalue":1,"svalue":"0"};
            break;
            
            case "Cool":
            msg.payload = {"command":"udevice","idx":159,"nvalue":1,"svalue":"10"};
            break;

            case "Dry":
            msg.payload = {"command":"udevice","idx":159,"nvalue":1,"svalue":"20"};
            break;

            case "Heat":
            msg.payload = {"command":"udevice","idx":159,"nvalue":1,"svalue":"30"};
            break;
            
            case "Fan":
            msg.payload = {"command":"udevice","idx":159,"nvalue":1,"svalue":"40"};
            break;

        }
    break;
    
    case "eco":
        
        switch (msg.payload[1]) {
    
            case "Auto":
            msg.payload = {"command":"udevice","idx":161,"nvalue":1,"svalue":"0"};
            break;
            
            case "Quiet":
            msg.payload = {"command":"udevice","idx":161,"nvalue":1,"svalue":"10"};
            break;

            case "Powerful":
            msg.payload = {"command":"udevice","idx":161,"nvalue":1,"svalue":"20"};
            break;
            
        }
    break;
    
    case "airSwingVertical":
        
        switch (msg.payload[1]) {

            case "Auto":
            msg.payload = {"command":"udevice","idx":163,"nvalue":1,"svalue":"0"};
            break;
            
            case "Down":
            msg.payload = {"command":"udevice","idx":163,"nvalue":1,"svalue":"10"};
            break;

            case "DownMid":
            msg.payload = {"command":"udevice","idx":163,"nvalue":1,"svalue":"20"};
            break;

            case "Mid":
            msg.payload = {"command":"udevice","idx":163,"nvalue":1,"svalue":"30"};
            break;
            
            case "UpMid":
            msg.payload = {"command":"udevice","idx":163,"nvalue":1,"svalue":"40"};
            break;

            case "Up":
            msg.payload = {"command":"udevice","idx":163,"nvalue":1,"svalue":"50"};
            break;

        }
    break;
   }
}

if (msg.topic == "panasonic/slaapkamer"){ 

switch (msg.payload[0]) {

    case "temperatureInside":
    msg.payload = {"command":"udevice","idx":141,"nvalue":0,"svalue":msg.payload[1]};
    break;
    
    case "temperatureOutside":
    msg.payload = {"command":"udevice","idx":165,"nvalue":0,"svalue":msg.payload[1]};
    break;  
    
    case "temperature":
    msg.payload = {"command":"udevice","idx":142,"nvalue":0,"svalue":msg.payload[1]};
    break;
    
    case "power":
    msg.payload = {"command":"switchlight", "idx": 166, "switchcmd": msg.payload[1]};
    break;
    
    case "fanSpeed":

        switch (msg.payload[1]) {
            
            case "Auto":
            msg.payload = {"command":"udevice","idx":158,"nvalue":1,"svalue":"0"};
            break;
            
            case "Low":
            msg.payload = {"command":"udevice","idx":158,"nvalue":1,"svalue":"10"};
            break;

            case "LowMid":
            msg.payload = {"command":"udevice","idx":158,"nvalue":1,"svalue":"20"};
            break;

            case "Mid":
            msg.payload = {"command":"udevice","idx":158,"nvalue":1,"svalue":"30"};
            break;
            
            case "HighMid":
            msg.payload = {"command":"udevice","idx":158,"nvalue":1,"svalue":"40"};
            break;

            case "High":
            msg.payload = {"command":"udevice","idx":158,"nvalue":1,"svalue":"50"};
            break;

        }
    break;
    
    case "mode":
        
        switch (msg.payload[1]) {
            
            case "Auto":
            msg.payload = {"command":"udevice","idx":160,"nvalue":1,"svalue":"0"};
            break;
            
            case "Cool":
            msg.payload = {"command":"udevice","idx":160,"nvalue":1,"svalue":"10"};
            break;

            case "Dry":
            msg.payload = {"command":"udevice","idx":160,"nvalue":1,"svalue":"20"};
            break;

            case "Heat":
            msg.payload = {"command":"udevice","idx":160,"nvalue":1,"svalue":"30"};
            break;
            
            case "Fan":
            msg.payload = {"command":"udevice","idx":160,"nvalue":1,"svalue":"40"};
            break;

        }
    break;
    
    case "eco":
        
        switch (msg.payload[1]) {
    
            case "Auto":
            msg.payload = {"command":"udevice","idx":162,"nvalue":1,"svalue":"0"};
            break;
            
            case "Quiet":
            msg.payload = {"command":"udevice","idx":162,"nvalue":1,"svalue":"10"};
            break;

            case "Powerful":
            msg.payload = {"command":"udevice","idx":162,"nvalue":1,"svalue":"20"};
            break;
            
        }
    break;
    
    case "airSwingVertical":
        
        switch (msg.payload[1]) {

            case "Auto":
            msg.payload = {"command":"udevice","idx":164,"nvalue":1,"svalue":"0"};
            break;
            
            case "Down":
            msg.payload = {"command":"udevice","idx":164,"nvalue":1,"svalue":"10"};
            break;

            case "DownMid":
            msg.payload = {"command":"udevice","idx":164,"nvalue":1,"svalue":"20"};
            break;

            case "Mid":
            msg.payload = {"command":"udevice","idx":164,"nvalue":1,"svalue":"30"};
            break;
            
            case "UpMid":
            msg.payload = {"command":"udevice","idx":164,"nvalue":1,"svalue":"40"};
            break;

            case "Up":
            msg.payload = {"command":"udevice","idx":164,"nvalue":1,"svalue":"50"};
            break;

        }
    break;
  }
}

return msg;
and the output on node red is this

Code: Select all

22-5-2020 21:58:53node: 9828f9d.483f388
panasonic/living : msg.payload : array[1]
[ "readingfromdevice'Living'(d4f0…" ]
22-5-2020 21:58:54node: 9828f9d.483f388panasonic/living : msg.payload : array[2]
[ "id", "d4f027aa88086920e86a5b7cb84631…" ]
22-5-2020 21:58:55node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 138, nvalue: 0, svalue: "23" }
22-5-2020 21:58:56node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 137, nvalue: 0, svalue: "16" }
22-5-2020 21:58:57node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 139, nvalue: 0, svalue: "25.5" }
22-5-2020 21:58:58node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "switchlight", idx: 140, switchcmd: "On" }
22-5-2020 21:58:59node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 159, nvalue: 1, svalue: "30" }
22-5-2020 21:59:00node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 157, nvalue: 1, svalue: "0" }
22-5-2020 21:59:01node: 9828f9d.483f388panasonic/living : msg.payload : array[2]
[ "airSwingHorizontal", "Auto" ]
22-5-2020 21:59:02node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 163, nvalue: 1, svalue: "0" }
22-5-2020 21:59:03node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 161, nvalue: 1, svalue: "10" }
22-5-2020 21:59:10node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : array[1]
[ "readingfromdevice'Slaapkamer'(…" ]
22-5-2020 21:59:11node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : array[2]
[ "{'message'", "'Tokenexpires','code'" ]
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : array[1]
[ "readingfromdevice'Living'(d4f0…" ]
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : array[2]
[ "id", "d4f027aa88086920e86a5b7cb84631…" ]
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 138, nvalue: 0, svalue: "23" }
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 137, nvalue: 0, svalue: "16" }
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 139, nvalue: 0, svalue: "25.5" }
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "switchlight", idx: 140, switchcmd: "On" }
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 159, nvalue: 1, svalue: "30" }
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 157, nvalue: 1, svalue: "0" }
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : array[2]
[ "airSwingHorizontal", "Auto" ]
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 163, nvalue: 1, svalue: "0" }
22-5-2020 22:00:51node: 9828f9d.483f388panasonic/living : msg.payload : Object
{ command: "udevice", idx: 161, nvalue: 1, svalue: "10" }
22-5-2020 22:01:09node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : array[1]
[ "readingfromdevice'Slaapkamer'(…" ]
22-5-2020 22:01:10node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : array[2]
[ "id", "e5b4c4979fda3a3ccc56e186b7b05e…" ]
22-5-2020 22:01:11node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "udevice", idx: 141, nvalue: 0, svalue: "26" }
22-5-2020 22:01:12node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "udevice", idx: 165, nvalue: 0, svalue: "16" }
22-5-2020 22:01:13node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "udevice", idx: 142, nvalue: 0, svalue: "23.0" }
22-5-2020 22:01:14node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "switchlight", idx: 166, switchcmd: "On" }
22-5-2020 22:01:15node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "udevice", idx: 160, nvalue: 1, svalue: "30" }
22-5-2020 22:01:16node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "udevice", idx: 158, nvalue: 1, svalue: "0" }
22-5-2020 22:01:17node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : array[2]
[ "airSwingHorizontal", "Auto" ]
22-5-2020 22:01:18node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "udevice", idx: 164, nvalue: 1, svalue: "50" }
22-5-2020 22:01:19node: 9828f9d.483f388panasonic/slaapkamer : msg.payload : Object
{ command: "udevice", idx: 162, nvalue: 1, svalue: "10" }
ow forgot i removed the horizontal swing for my device this is manual onlt for bigger devices it can be set with the remote.

grts Gianni
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

Hi,

@Gianni,

Is it correct that I only see 5 positions for Fanspeed in the "Slaapkamer", while 6 in the Living?

And you have only one swing and not vertical and horizontal?
How is that in the MQTT output, as I saw that there were different values for Vertical and Horizontal?

And I do not see a fan in the Mode switch.


Find below a flow to control the thermostat.

It is only for he Living (I think)

You can copy it to same page. It does not replace the other.

Code: Select all

[{"id":"a55d1886.0b0e68","type":"debug","z":"5bae5c9d.cc469c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":790,"y":820,"wires":[]},{"id":"cd5824d5.88c28","type":"mqtt in","z":"5bae5c9d.cc469c","name":"Domoticz Out","topic":"domoticz/out","qos":"2","datatype":"json","broker":"c2d9657a.d81bf8","x":150,"y":820,"wires":[["c939d06.df4863"]]},{"id":"c939d06.df4863","type":"filter","z":"5bae5c9d.cc469c","name":"Filter Thermostat","property":"payload.idx","propertyType":"msg","asArray":false,"itemProperty":"","itemPropertyType":"item","rules":[{"t":"eq","v":"10","vt":"str","output":1}],"checkall":"true","outputs":1,"x":370,"y":820,"wires":[["a8b02665.ea42d"]]},{"id":"a8b02665.ea42d","type":"change","z":"5bae5c9d.cc469c","name":"Set Payload","rules":[{"t":"move","p":"payload.svalue1","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":820,"wires":[["a55d1886.0b0e68","b0b60272.1450d8"]]},{"id":"b0b60272.1450d8","type":"exec","z":"5bae5c9d.cc469c","command":"python3 /home/gianni/panasonic/pcomfortcloud.py login pasword set 1 -t ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Execute Thermostat","x":800,"y":760,"wires":[[],[],[]]},{"id":"c2d9657a.d81bf8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Probably you have to install the Filter node, as you did before.

Do not forget to change the IDX in the Filter node!
Let me know.

Regards
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

hey FireWizard
Is it correct that I only see 5 positions for Fanspeed in the "Slaapkamer", while 6 in the Living?
thx corrected this
And you have only one swing and not vertical and horizontal?
How is that in the MQTT output, as I saw that there were different values for Vertical and Horizontal?
i think the "get" is generic for some more devices.
And I do not see a fan in the Mode switch.
In my app in only got auto,dry cool and heat
Find below a flow to control the thermostat.

It is only for he Living (I think)

You can copy it to same page. It does not replace the other.

Do not forget to change the IDX in the Filter node!
Let me know.
in the excecute node i added the pasword and login into the command but where do is change the idx in the filter node?

grts Gianni
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

Hi

@Gianni

If you open the Filter node, you see currently a 10. Change that to your Thermostat IDX.

Regards
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

thx

changed the idx but get a error on node red when is changed the temp from within domoticz
error2l.JPG
error2l.JPG (69.75 KiB) Viewed 1147 times
and i filter only on the second flow ,you see i set the temp on 20° but after a while it's back to the original temp
error3.JPG
error3.JPG (24.03 KiB) Viewed 1147 times
grts Gianni
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

fixed the first error
python3/home/gianni/panasonic/pcomfortcloud.py login pasword set 1 -t
to python3 home/gianni/panasonic/pcomfort..................
but now i get a error code 2
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: help with panasonic cloud

Post by FireWizard »

Hi,

@Gianni
fixed the first error

python3/home/gianni/panasonic/pcomfortcloud.py login pasword set 1 -t

to python3 home/gianni/panasonic/pcomfort..................

but now i get a error code 2
I see that you had no space between python3/home/gianni................
You changed it but it should be:

Code: Select all

python3 /home/gianni/panasonic/pcomfort.
instead of

Code: Select all

python3 home/gianni/panasonic/pcomfort.
A / before home.
Try it

Regards
Last edited by FireWizard on Saturday 23 May 2020 9:11, edited 1 time in total.
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: help with panasonic cloud

Post by Gianni »

i see this message to late ;-)
I was starting to debug myself with node red and add a msg.payload after the execute and then i could see the error that the sript was not found.
I made indeed a mistake to remove the /home slash

NOw it s works :P :P

grts Gianni
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest