@Gianni
Please find below a bash script that runs every minute. I suggest during testing to use a shorter period than 10 minutes.For the request maybe every 10 min?
Otherwise you have to wait so long. Unless the Panasonic Cloud service does not permit a call every minute.
The sleep command is now 57 seconds as the time it needs for publishing the MQTT message is about 3 seconds.
But you can check that and play with the value. Later on you can change that to 597 (10 minutes).
You can also add your second MQTT message, e.g for the bedroom. E.g. 10 seconds after the living.
If this bash script runs fine, you will see a new MQTT publication every minute.
I called the script "panasonic2mqtt.sh" and you have to make it eXecutable. (chmod +x panasonic2mqtt.sh)
Code: Select all
#!/bin/bash
# Script to push panasonic cloud to mqtt
# Uses mosquitto_pub
while :; do
python3 pcomfortcloud.py login pasword get 1 | mosquitto_pub --url mqtt://127.0.0.1/panasonic/living -s
sleep 57
done
I assume you have also installed Node Red on the same hardware as Mosquitto, Domoticz and your pcomfortcloud.py script.
If your browser is also installed on the same hardware use IP address 127.0.0.1 or otherwise the IP address of the device, which has Node Red installed.
If so open a browser and go to http://127.0.0.1:1880 and the Node Red workbench will open
In the "Hamburger" menu at the top right, go to "Import" and paste the following flow:
Code: Select all
[{"id":"5bae5c9d.cc469c","type":"tab","label":"Pansonic Cloud","disabled":false,"info":""},{"id":"895546b7.2d10c","type":"mqtt in","z":"5bae5c9d.cc469c","name":"MQTT In","topic":"panasonic/living","qos":"2","datatype":"auto","broker":"c2d9657a.d81bf8","x":160,"y":320,"wires":[["d0c887a4.afd0e"]]},{"id":"d0c887a4.afd0e","type":"debug","z":"5bae5c9d.cc469c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":330,"y":320,"wires":[]},{"id":"c2d9657a.d81bf8","type":"mqtt-broker","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":15,"cleansession":true,"birthQos":"0","willQos":"0"}]
Go to the debug pane (the bug symbol just under the "Hamburger" menu.
If both the bash script and the Node Red flow are correctly installed, you will see approx. every minute the result in the debug pane.
Can you publish the content of what you see. A screenshot would be fine.
Regards