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.
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.