LordMike / MBW.BlueRiiot2MQTT

Utility to map between Blue Riiots pool API, and Home Assistant MQTT
49 stars 2 forks source link

HassIO add-on full configuration of environment variables #28

Closed gllmlbrt closed 3 years ago

gllmlbrt commented 3 years ago

Hi, I was very happy to see that this was tuned into an Hassio supervisor add on ! great ! and I made it all connect just fine. However I am still at a loss to find out how to enter some of the environment. I suggest you clarify that in the readme ? For instance how to we specify th MQTTClientId: and HASSTopicPrefix ?

LordMike commented 3 years ago

For the HASSIO addon, you only have a select few options available. They're here, below. You should see them when you add the addon - don't they appear as below (only the marked part) ?

https://github.com/LordMike/hass-addons/blob/dc9e26d753cbb499c0dcf109a7155c2075bd1be3/blueriiot2mqtt/config.json#L13-L25

Anyhoo. You can't specify topic prefix and client id with the Hassio config as it is now :P

LordMike commented 3 years ago

I looked into it back then, and I concluded that for convenience, I would only provide the barebones config. The issue is really that as you might've noticed, the full config appears on the screen when you deploy the app the first time. So to avoid any issues with users not understanding what they should fill out, I opted to have the reduced config.

I could present the full config (or just more of it) as needed... but I sure hope users won't get confused.. :)

LordMike commented 3 years ago

One could argue that I shouldn't have left the username and password as "null", but maybe as "FILL ME"..

gllmlbrt commented 3 years ago

Ok i understand. I bit of a shame but makes sense. However, if people did not get confused earlier, then what leads you to think that they would get confused with the additional options when using the Add-ons. Besides, it might only take that you clearly guide on what is mandatory, and what is optional in the "readme" ?

gllmlbrt commented 3 years ago

For the HASSIO addon, you only have a select few options available. They're here, below. You should see them when you add the addon - don't they appear as below (only the marked part) ?

https://github.com/LordMike/hass-addons/blob/dc9e26d753cbb499c0dcf109a7155c2075bd1be3/blueriiot2mqtt/config.json#L13-L25

Anyhoo. You can't specify topic prefix and client id with the Hassio config as it is now :P

Yes they show perfect. I just tought it migh tbe possible to add optional environment items.

Is there a way to input it manually in the add-on files ?

LordMike commented 3 years ago

I don't really know if it's possible. I don't use Hassio myself ... :)

I can add those two options though, and change the defaults for mandatory options so they're more visible.. I don't actually know if people got confused - I just assumed.. :P

Are there any options besides those two?.. ClientId & Prefix ?

gllmlbrt commented 3 years ago

Hi, yes that would be great. I am currently using: MQTTClientId, HASSTopicPrefix and BlueRiiot__UpdateInterval

But frankly i thought it was a great feature to have all the others, and also I saw people who liked to not have auto discovery in Hass.

So wouldn't be better to have them all in there, and pre-fill the default value. Noting in the Readme that there are effectively only 4 which need to be filled with "FILL ME" as you said ?

LordMike commented 3 years ago

Could try that.

LordMike commented 3 years ago

@Nordicfastware could you try this out? .. I'm not able to test it myself, but I should work. If it doesn't, I need to fix it as it will be broken for everyone .. :P

gllmlbrt commented 3 years ago

Great ! Tried it, only had to uninstall, reload the repo, and re-install (because it did not show as an update). I specified some non default items, changed the topic etc.. and it all seems to work just fine and show up as expected on MQTT explorer. Add-on log upon start-up shows no error or warning.