MQTT Image

MQTT

Cerbo MQTT to control Shelly Relay over Node-Red

I am trying to control a Shelly relay using Node-Red. Im trying to do this using MQTT. I have found my MQTT victron server and have been able to set up a connection over node red. The only thing I cant get to work is the MQTT for the Shelly. I have attached some photos to try explain better. Any help would be greatly appreciated!!

[image]

[image]


brittneywoodgate asked

0 Answers

Connect to Cloud VRM MQTT with node-red

A little tutorial on how to connect and receive data from the cloud MQTT server into node-red.

This involves 2 steps:

  1. Subscribe to a topic to the right mqtt server. (you will need to calculate the address of your system - see below for details)
  2. Schedule a node to send a "keepalive" message every 50 second to keep receiving data


Subscribe to a topic

1. Use the "mqtt in" node and double click to configure.

[image]

2. Configure the topic you want to subscribe to. The example above will subscribe to the power out status. (other example topic: N/<yourVRMportalD>/system/0/Dc/Battery/Soc for battery status.)

Your VRM portal ID can be found on either:

  • The console under settings/VRM Online Portal
  • The web application under settings/general

3. Configure the output to be a string

4. Give the node a name

5.Configure the server: choose "Add new mqtt-broker" from the server drop down.

[image]

6. Click the pencil to edit.

[image]

7. Fill in your mqtt server address. You need to calculate this address from your Victron installation ID. Yours will probably be different from the screenshot below.

(more details on how you calculate the address can be found here: https://community.victronenergy.com/questions/155407/mqtt-local-via-mqtt-broker.html under the section "Cloud MQTT broker")

[image]

8. Click on the pencil next to "TLS configuration"

9. Upload the "venus-ca.crt" file which you can find on github: https://github.com/victronenergy/dbus-mqtt

[image]

Send a "keepalive" message to receive data

This is important to keep receiving data. Without this step your value's won't keep receiving!

1. Use an inject-node and schedule it to run every 50 second.

[image]

2. Fill in the topic with "R/<yourVRMportalID>/keepalive" and leave the msg.payload blank.

3. Use a "mqtt out" node like this:

[image]

You should now start receiving messages:


[image]


horemansp asked
akasha answered ·

2 Answers

Node Red MQTT - Just says connecting

Hi

I am trying to get MQTT within node red from my Multiplus II GX working.

I have followed all the instruction the following post but it just says connecting. I have gone through the instructions a few times to be sure I have not made a mistake. https://community.victronenergy.com/questions/174616/connect-to-cloud-vrm-mqtt-with-node-red.html

I have the port set @ 8883
I have the URL set at mqtt87.victronenergy.com
as per https://community.victronenergy.com/questions/155407/mqtt-local-via-mqtt-broker.html

One thing I noticed is that within the instructions I have not set anything under security.

I am sorry for the lack of detail in my question, but if anyone can point me in the right direction to work out why, I would be very grateful.

Thanks

Tom



tashbee asked
tashbee answered ·

2 Answers

MQTT values periodically corrupted (2.9X and 3.00beta)

Hello - I am using a Multiplus GX with a pylontech battery stack.

I am collection the process data via the internal mqtt-broker from the gx unit - this values are used in different systems (influx, nodered, grafana, home assistant). My problem is, that the battery values (current, voltage, power) are sometimes corrupted (like a overflow). First I thought, that my data processing is doing "somthing wrong" - but I have broken it down to the internal broker and i can see (e.g. with mqtt-explorer) that the .json data from the multiplus seems to be wrong...

Attached you can see a screenshot of the described phenomenon.

[image]

It happens first with the 2.9X version of the venusOS - actually I have installed the 3.00-21 as beta to see if the behavior changes - it does not change.

I have although activated the VRM-Data (which was deactivated in the past) to see if I have the same strange data - no: the data in the VRM seems to be ok. I haven never ever get some warnings or alerts from the system, so I thing the internal values "inside" the multiplus are ok - but the mqtt data is definitely corrupted.

Perhaps an interesting bug - If anyone has an idea, what to do or to check: feel free to comment my question ;)

jago asked
jago answered ·

7 Answers

Keepalive via Node-Red an die Venus senden für NSM Einbindung via MQTT

Hi,

ich wurde gebeten, meine Frage im deutschen Bereich nochmals zu stellen, here we go:

Mein Netzbetreiber fordert eine Einbindung meiner Erzeugungsanlage in das Netzssicherheitsmanagement. Mit einem ESP32 lese ich bereits erfolgreich den Relaiszustand "NSM" aus.

Wenn das Relais abfällt, möchte ich per MQTT die Netzeinspeisung auf "NULL" setzen, wenn es wieder anzieht wird wieder eingespeist.

Dazu wäre es sehr hilfreich, den Keepalive aus Node-Red alle 60 Sekunden an die Venus zu senden. Mit dem MQTT-Explorer klappt das, aber aus Node-Red nicht. Vermutlich sendet Node-Red kein JSON und damit kenne ich mich auch nicht aus. (ggfs. will ich es in FHEM umsetzen und das komplette Reading killt mir FHEM, weil zu viele Daten!

Alle Datenformate (String, JSON), mit geschwungener Klammer, mit und ohne Payload, etc. funktionieren nicht.


Screenshot des Versuchs mit Node-Red:

[image]

In MQTT Explorer sende ich:

[image]


und erhalte das gewünschte Ergebnis:


[image]



Screenshot MQTT Explorer, um z.B. die Einspeiseleistung auf Null zu setzen:

[image]


[image]


...auch das bekomme ich aus Node-Red nicht hin bisher.


Joe asked
Joe edited ·

11 Answers

Keepalive via NodeRed to Venus

All,

for establishing a MQTT based solution for a power reducer box I am step by step getting there.

Sending an R/<ID>/keepalive even with filtering for example to ["settings/#"] works from scratch via MQTT broker, but I am not getting it up with NodeRed. As I want to shoot every 60 seconds, Node-Red would be the perfect solution.

It can only be a "JSON Format" issue, but whatever data format I chose (string, JSON, ..) it does not work.


Can anybody please educate me, what I am doing wrong? I have literally tried everything (with brackets {[]}, w/o, etc.


[image]


Joe asked
marc-hd commented ·

5 Answers

EV mqtt Steuerung Pylontech erst mittags Laden, Auto morgens

Moin,


Ich hab da mal eine Frage an die Gruppe!


Ich habe eine 3P Victron Anlage und die EV Wallbox.


Ich nutze auch Node Red um alles zu Visualisieren und zu Steuern. Allerdings läuft NR extern und nicht auf dem Cerbo. Ich mache das alles per mqtt.


Gibt es eine Möglichkeit dem System zu sagen das er den Pylontech akku erst zu einer gewissen Uhrzeit laden soll und ich den Auto Modus an der EV Wallbox nutzen kann.


Gibt es da werte die man auslesen und schreiben kann? Wenn der Pylontech voll geladen ist funktioniert das ja auch ohne das er aus dem Akku läd.


Danke

manny84 asked
steffen-graap answered ·

1 Answer

Controlling an openEVSE electric vehicle charger using Node-Red and MQTT

This is not so much a question but more of offering what I have created to others in the community. I have been using the Node-Red add-on in Venus OS v2.70~5-large-18 to control my openEVSE car charger via MQTT. It maximises the available power from the PV array to charge the car. When there isn't enough power it will use what is stored in my BYD batteries and when they're depleted it uses the mains. It is now stable enough that I have placed the json file and a brief explanation on GitHub (https://github.com/thepaulcooper/victron-openEVSE).

Disclaimer: I am not an expert in JavaScript or Node-Red so I am sure there are more effective ways of coding what I have created. But it works and I am now charging my car from the sun.

paulcooper asked
xavier-65 answered ·

3 Answers

Problem W/.../settings/0/Settings/CGwacs/MaxChargepower /MaxChargePercentage not working

Hi All,

I have a Multiplus, working in Mode 1 and I can not prevent it from charging.

- I set the values for W/.../settings/0/Settings/CGwacs/MaxChargepowerW/.../settings/0/Settings/CGwacs/MaxChargepower and /MaxChargePercentage with Node-Red over MQTT.

- The Cebro accepts the values and I can read it with N/... .

- But it does not use the value, battery is charging till SOC-Limit is reached.

I am disappointed, because /MaxDischargePower and /MaxDischargePercentage are working properly. I can set the value and battery discharges like I need.

Has anybody a hint for me. Why the system works this way?

Thank you and best regards

Carsten



Hallo Leute,

ich betreibe einen Multiplus im Mode 1 und kann das Laden nicht begrenzen/unterbinden.

- Ich setze die Werte für W/.../settings/0/Settings/CGwacs/MaxChargepowerW/.../settings/0/Settings/CGwacs/MaxChargepower und /MaxChargePercentage über Node-Red mit MQTT.

- Sie werden auch angenommen, ich kann sie mit N/... lesen.

- Aber sie werden einfach nicht beachtet... Der Akku lädt fröhlich weiter bis zum SOC-Limit

Das komische daran ist, dass die Steuerung von /MaxDischargePower und /MaxDischargePercentage gar kein Problem sind... sie werden angenommen und beachtet.

Kann mir jemand einen Tipp geben, woran das liegen könnte?

Vielen Dank und viele Grüße

Carsten

carstenj asked
blackmarlin answered ·

1 Answer

mqtt topics published (W/.../) only once are being repeatedly used/subscribed by Cerbo GX

During some tests with NR and mqtt, using the Broker on the Cerbo, I noticed a strange behaviour.

I can change dbus values just fine, by publishing them via the W/.../ topic over mqtt.

After a publish, the Cerbo accepts the value and re-publishes it via the N/.../ topc tree just fine.

However, after the Cerbo excepted the new value, the W/.../topic does not get deleted from the Broker, although the retain flag has been set to false during publish.

Following this, one can see that same value re-appears after some time without a re-publish had been taken place (tested by the value had been manually changed to a different value via the GX menu beforehand and NR flow had meanwhile been stopped - so no external commands/manual interaction with mqtt broker on the Cerbo).

As far as I can tell, it is reproducable and "re-publish" takes paces, some time after midnight, when a new day started.

I actually consider this a bug in the Cerbo/Venus OS implementation, don't you think?

It normally is good practice that, after a topic without retain flag has been published, it gets deleted by the sole subscriber, to mimick a get/set remote control scheme, like with N/.../ and W/.../ topics on dbus.

...or am I missing something here?

hominidae asked
hominidae edited ·

0 Answers

idea

Will an upgrade from v2.70~5-large-18 to v2.90-large go smoothly?

I've been running Node-Red on my MultiPlus-II GX for over a year without any issues. I use it to manage my EV charger and hot water heating (using MQTT) based upon the available power from my PV and battery. It just works so I have not upgrade since v2.70~5-large-18! I have been waiting for the full release of v2.90-large so that I am no longer running with 'experimental' or beta code. As it seems imminent I am wondering whether there be any issues when I do the upgrade? What should I be checking? I will of course backup my NR flows before making the upgrade but will I need to do much in terms of making adjustments for the updated Victron nodes? Thanks in advance for any assistance.

paulcooper asked

0 Answers

Expected traffic to the mqtt{1 to 128}.victronenergy.com server farm?

I am running Venus-large and have a fairly extensive Node-Red flow consisting of about 100 nodes. My router is reporting a permanent TCP/IP session with one of the mqtt{1 to 128}.victronenergy.com servers with constant traffic of just over 10 kbit/s upload and just under 1 kbit/s download. This seems high to me but maybe it's because of my 100-node flow. Is this level of traffic to be expected?

paulcooper asked
paulcooper answered ·

1 Answer

Control MultiPlus II via MQTT

Would it be possible to control a MultiPlus II via MQTT ?

What I'm thinking is to disconnect the mains in relay off between 16:00 - 19:00 this would be because on the Octopus Agile tariff here in the UK is the very expensive period. During this period my house would run from batteries via the inverter in the MultiPlus II. The control would come from Node-red.

myozone asked
homestorage-77 commented ·

6 Answers

mqtt Energy Meter for 600/5 CT

Can any one advise if there is a Energy Meter available that accepts the 5A secondary for larger CT ratios 600/5 that could publish real time kw out every 1 or 2 seconds in the form of an mqtt publish.

I would like to read this value into a Venus running Node Red which is 100m away from the Energy Meter.


markus-001 asked

0 Answers

16 Posts
177 Users
7 Followers

Topic Experts

taylortops
126 Points
nickdb
112 Points