How do I access emon/emontx1/power1 from a python script?

It would be interesting and educational (for me) to access the feed that is presumably constructed by my emonPi which gets data by radio from my emontx v3.

I know it exists on the network because my openEvse picks it up and can use it to modulate the power to the car.

The car charger uses the feed emon/emontx1/power1 This is also used by node red which I have extended to construct a very crude water heater switch.

I am not sure exactly what form this feed takes. Is it like a GET or PUT to a website? How would one access it using a Python script.

Many thanks

This is an MQTT topic, I think.

By subscribing to the MQTT topic on the MQTT Broker on the EmonPi.

You can access the MQTT Broker from a variety of apps.

Thanks for that. So presumably the openEvse car charger accesses the MQTT topic, as you say. I have found a tutorial Python: Subscribing to MQTT topic - techtutorialsx that explains how to do it from a Python script. I will have a go when I have time. Thanks again.

1 Like

Alternatively, if you really want the feed from emoncms, go to your Feeds page and click the API help link for how to get it on http. Python’s http and json modules can work with that.


Where it says " * Append on the URL of your request: &apikey=APIKEY" could you please tell me what the URL is? Is it simply the local IP which is or is there an emoncms or something after that?

thanks again

If you take a look in Emoncms at Setup > Feeds you see top right Feed API Help. Click that and you see all info…