Community
OpenEnergyMonitor

Community

2 OpenEVSEs MQTT

So I have 2 OpenEVSE chargers and I would like to integrate them both over MQTT to the EmonCMS. I can get 1 to connect and show data, but when I bring the other one in it shows connected, but no data shows and I see no change on the inputs of EmonCMS

You should set the base topic to be different on the 2nd unit e.g emon/openevse2

I’m done that, but it never seems to show up. Wonder if I’m not waiting long enough.

@glyn.hudson, is the MQTT Client ID hardcoded? If so the MQTT broker will complain 2 devices using same ID.

That is something I’m wondering myself.

If you check the MQTT log, you will see errors (if there is an issue).

cat  /var/log/mosquitto/mosquitto.log

Does the first one you start always work?

It appeared to, yet when I brought in the 2nd OpenEVSE it never seemed to appear. Will take a look at that log.

So If you start the first it works fine. If you stop the first and just start the second, what is happening? Do you ever see the second set of data?

Here’s what I see with OpenEVSE2 only submitting over MQTT.

When I bring in OpenEVSE1 over MQTT this is what it shows on the inputs.

There is a new input of 0, but nothing else. I’m guessing they are conflicting and this is MQTTs way of handling that.

Just a bit more data. Here is what it shows if I stop OpenEVSE2 MQTT and leave OpenEVSE1 MQTT running. It looks like it just adds OpenEVSE1’s inputs now and accepted them.

Ok, so the base topic for that is openevse

What if you stop that one and start the second one?

You should get a second set of inputs under openevse2

If you don’t, try using the IP address of the EmonPi as the host (generally more reliable anyway) in the settings of the openevse.

You know what. I see what the problem is. I already had an openevse2 in there for the main connection for my feeds. It was being masked under that when I put that for the base-topic. Changed it to openevse22 and sure enough there it is.

2 Likes

Yes, it is fixed on the V2.x ESP8266 version, the new ESP32 V3.x version uses the ESP chip ID. This version is still in beta: https://github.com/openevse/ESP32_WiFi_V3.x/

I think my experience even through mosquitto complains in the log it doesn’t functionally make any differance if the same ID is used as long as the topics in use are different. I will need to test this again to be sure.

@Ryan_S could you post a screenshot showing your MQTT config settings on both OpenEVSE’s?

Certainly.

Here is OpenEVSE1

And here is OpenEVSE2

At this point I don’t see an advantage to the MQTT for myself as the charge shaping is based on UK data and not my local data, but I do want it connected as I am looking at putting solar on my roof after a roof replacement next year.

That looks correct. However, I see the data is showing up on your Emoncms Inputs page with node name “openevse” rather than “openevse3” open “openevse4” a I would expect.

Do you know where “openevse” could be coming from? Do you have a third openevse somwhere?!

My experience is the opposite. I had 2 instances of emoncms talking to the same Broker (when the client_ID was hardcoded) and it complained vociferously!

Easy enough to check in the mosquitto logs IIRC.

That was when I was originally using emon/openevse not realizing that leaving both the same would result in them overlapping. I have since changed them to what you see above and deleted the openevse input as it is not longer needed.