Closed KidA001 closed 3 years ago
Without checking it thoroughly I'd say if you have only one solar controller you can swap the instance number with a path level wildcard, a '+'-sign, so: N/${portalId}/solarcharger/+/State
And FYI, there is a fix planned for Venus OS to make those IDs static. Basically, Venus OS will reserve an ID for a certain MPPT serial number, and re-use that.
Instead of the method used now that can (only sometimes) cause renumberings
And some more context on how we handle it elsewhere in the app, see this source code: src/app/mqtt/victron/GetInverterChargerDeviceInstance.js
@thlassche @mpvader thanks for the feedback. I tried the MQTT +
wildcard before and it throws an error, but I think what you're doing in GetInverterChargerDeviceInstance.js
might help. I'll see if I can replicate another object to do something similar for my charge controller.
@mpvader I would love if Venus moves to static/UUID's for devices. I've had my device-id change once before on me which is why I wanted something more reliable. Thanks
I modified Solar.js to show the state-of-charge as I often wanted to know what state my charge controller is in. What I don't love is the hardcoded device ID for my Solar Charge Controller
N/${portalId}/solarcharger/289/State
. Is there a way for me to programmatically identify or see a list of available solar charge controllers I can subscribe to?Sorry if this isn't the place for the question. I posted on the Victron Community forums under modifications but didn't receive any answers.
Modified code is below:
(p.s. I really love working on this application, you all have done a great job coding it. I've made some slight modifications to the dashboard so that I can display my Hot Tub temperature and turn it on and off :) )![venus](https://user-images.githubusercontent.com/8673088/100244034-5d279700-2eeb-11eb-9873-e30285f207c3.jpg)