Hi guys,
Is there a way to make pimatic-mqtt pause trying to make a connection to a certain broker? I get the power output of my solar-inverter this way, but it seems rather pointless to me to keep trying that when the sun is down
Pimatic-mqtt pause connection to certain broker
Hi guys,
Is there a way to make pimatic-mqtt pause trying to make a connection to a certain broker? I get the power output of my solar-inverter this way, but it seems rather pointless to me to keep trying that when the sun is down
Why is your Broker offline if the inverter is not producing power?
You should send your values directly to the pimatic broker…
@michael-rudek The only way I seem to be able to connect to my invertor is via an external service, see this post https://forum.pimatic.org/topic/2939/mastervolt-soladin-grid-connected-solar-invertor and this one https://forum.pimatic.org/topic/4136/can-t-connect-to-external-server-via-mqtt .
I am very pleased having that going now, pimatic rocks . However it seems pointless to keep trying to connect to this external broker when i know the invertor is no going to respond. I can of course determine when it’s down by pinging it on the local network, so i would like pimatic-mqtt to stop making the effort. Untill it’s back online of course.
Ow btw i forgot to mention: the inverter shuts down without solar power, but that’s rather obvoius
I think I didn’t explain the issue correctly. The connection with the broker is there, but the broker doesn’t get any values from my inverter since it has no power. This results in the following repeating error:
21:41:38.058 [pimatic-mqtt] info: Reconnecting to MQTT Broker mastervolt
21:41:38.370 [pimatic-mqtt] info: Successfully connected to MQTT Broker mastervolt
Unhandled rejection Error: Expected variable solarpower.AC.0.P to have a numeric value.
at /home/pi/pimatic-app/node_modules/pimatic/lib/variables-ast-builder.coffee:111:17
at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14)
at processImmediate [as _immediateCallback] (timers.js:383:17)
21:42:38.064 [pimatic-mqtt] info: MQTT Broker mastervolt is offline
21:42:39.070 [pimatic-mqtt] info: Reconnecting to MQTT Broker mastervolt
21:42:39.516 [pimatic-mqtt] info: Successfully connected to MQTT Broker mastervolt
What happens if you set your variable to string
instead of number
?
No change at all. It still wants a number and the number would be zero, i guess.
Couldn’t you combine your rule with the sunset parameter?
If bla and if it’s before sunset…
For solving the missing mqtt value problem try to set the “retain” property in the messages.
@saxnpaule said in Pimatic-mqtt pause connection to certain broker:
For solving the missing mqtt value problem try to set the “retain” property in the messages.
How would i do that? MqttSensor doesn’t seem to have that option.
@saxnpaule said in Pimatic-mqtt pause connection to certain broker:
Couldn’t you combine your rule with the sunset parameter?
That was my first thought, but i wouldn’t know how to either shut down the device temporarily or disable the entire plugin without a pimatic restart.
Your mastervolt needs to add the retain parameter. Then every subscriber will get the last valid value until there’s a new one.