Python coding

Redirect data from robonect API to MQTT

last updated: 2024-06-20

Quick links

pyshpcreator

Short description

My Husqvarna automover 320AC from 2014 celebrates its 10th birthday!. However, he is also showing signs of ageing :). One of the signs is, that he stops sometimes while trimming, even if the battery isn't empty and shuts off. I read that the motors can cause this behavior.

My robby has a WiFi communication module from robonect that shows the motor data in the homepage. Also MQTT is enabled, but the motor data is missing in MQTT. So I wrote a little python script to get the data from the robonect API and transfer it to MQTT.

Here a screenshot showing the data in MQTT Explorer:

pyshpcreator

A cronjob runs the code at startup of my home server (Linux).

Now I can look at the data in openHAB. Everything is on github.

Python code


Crontab

OpenHAB code

Downloads