question

4711austria avatar image
4711austria asked

initial pull from Mqtt variable ?

Hi,

do need an inital pull from the value of the Mqtt In node, does not feed an value, until it changes

what could I do to get on Node-red start the value?

Thx

bildschirmfoto-2024-02-21-um-080724.png

Node-RED
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

elvis avatar image elvis commented ·

@4711Austria

If you are on a recent firmware that now has FlashMQ you can send a keep alive and "ALL" values are refreshed. Do this after your connection to the broker.

0 Likes 0 ·
4711austria avatar image 4711austria elvis commented ·
thx for the info, which SW-Version do I need and which node would that be? thx
0 Likes 0 ·
1 Answer
matt1309 avatar image
matt1309 answered ·

Hi @4711Austria

Store the value in a variable and if that variable is equal to null then manually set it to a static initial value.

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4711austria avatar image 4711austria commented ·
like a trigger with initial setting on the check node, but this seems not to do the job, I do get an error about BMS lost, Voltage low -> there is no BMS active, but I need to poll the operational limits, otherwise the MP2 stop.
0 Likes 0 ·
matt1309 avatar image matt1309 4711austria commented ·
I imagine you'd need it done separate to check node. Guessing the check node only runs when a value is presented and instead you want a value if nothing has been sent yet.


I would add somewhere in your flow that the value is stored in a global variable or something similar then periodically check if that var is null and if it is send initial value to the output.


The other option is checking what's in your endpoint if that endpoint is null then send initial value.

0 Likes 0 ·
4711austria avatar image 4711austria matt1309 commented ·

actually I do that what you write, I think (without writing into a flow/global varibale)

but often on restart on node-red the cerbo shows BMS lost.

bildschirmfoto-2024-02-22-um-174105.png

0 Likes 0 ·