diff --git a/.images/UIoptions.PNG b/.images/UIoptions.PNG new file mode 100644 index 0000000..176f10a Binary files /dev/null and b/.images/UIoptions.PNG differ diff --git a/.images/mqttcap.PNG b/.images/mqttcap.PNG new file mode 100644 index 0000000..1bc03b7 Binary files /dev/null and b/.images/mqttcap.PNG differ diff --git a/.mdlrc b/.mdlrc index 3974e0b..fff295f 100644 --- a/.mdlrc +++ b/.mdlrc @@ -1,2 +1,2 @@ # Exclude line length -rules "~MD013", "~MD026", "~MD022" \ No newline at end of file +rules "~MD013", "~MD026", "~MD022", "~MD033", "~MD034" diff --git a/haos-sbfspot/CHANGELOG.md b/haos-sbfspot/CHANGELOG.md index 9ab63e6..7f4403e 100644 --- a/haos-sbfspot/CHANGELOG.md +++ b/haos-sbfspot/CHANGELOG.md @@ -2,6 +2,50 @@ # ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Fhabuild%2Fhassio-addons%2Fmain%2Fhaos-sbfspot%2Fconfig.yaml) +- Bump to SBFspot 3.9.6 +- BREAKING CHANGES +- Major overhaul of options +- Most options have defaults set that will be used when options left blank +- Secrets template provided in the readme! + +

+ +- MQTT user and pass have moved locations in options +- MQTT Publisher args option has been disabled + +

+ +- AUTOGEN SENSORS +- List of upto 39 sensors available +- New Option create or purge sensors (defaults to No) +- Some Sensors start disabled in the MQTT integration +- (They can be enabled in the MQTT integration) +- Disabled sensors are not automatically deleted by the MQTT integration (Purge will get them) +- Sensors can now be created and purged via the Addon and HA MQTT integration +- Backup and disable/remove existing yaml sensors to avoid naming conflicts +- MQTT_Data list can be used to create desired Sensors. + +

+ +- custom timestamp can be set for InvTime SunRise and SunSet +- Timestamp sensor can not use custom timestamp +- (can be changed by value_template in a lovelace card) + +

+ +- Logging to *.txt file is being removed from SBFspot 3.9.6 onwards +- option for logging dir removed to accommodate this change + +

+ +- Cleaned up readme... +- updated translations to reflect options changes +- bump curl dev dependancy + +## ![Release][release-shield-2022-8-4] + +[release-shield-2022-8-4]: https://img.shields.io/badge/version-2022.8.4-blue.svg + - Created translations to give more detail to UI options. - MQTT_Enable option has been removed. - It has to be manually removed via yaml options to stop supervisor log warning about it. diff --git a/haos-sbfspot/DOCS.md b/haos-sbfspot/DOCS.md index da6c2d6..01a1ad3 100644 --- a/haos-sbfspot/DOCS.md +++ b/haos-sbfspot/DOCS.md @@ -1,3 +1,5 @@ +--- + # SBFspot addon for HAOS ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Fhabuild%2Fhassio-addons%2Fmain%2Fhaos-sbfspot%2Fconfig.yaml) @@ -10,7 +12,7 @@ [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fhabuild%2Fhassio-addons) -This [home assistant](https://www.home-assistant.io/getting-started/) add-on provides a wrapper for the **Bluetooth** version of [SBFspot 3.9.5](https://github.com/SBFspot/SBFspot/releases/latest). +This [home assistant](https://www.home-assistant.io/getting-started/) add-on provides a wrapper for the **Bluetooth** version of [SBFspot 3.9.6](https://github.com/SBFspot/SBFspot/releases/latest). This add-on runs a crontab service for SBFspot and SPFspotUploader at 5 minutely daytime interval. @@ -24,44 +26,180 @@ This add-on runs a crontab service for SBFspot and SPFspotUploader at 5 minutely ## Installation +--- + +### Options and Secrets + +If you want to template your options with secrets, the below template can be used. + +These names auto default so you shouldn't need to confirm(save) any options on installation + +It should all just default when starting the addon. + +``` +##template for secrets.yaml +## a restart might be required after Saving your secrets file + +BTAddress: "" ## Inverter BT mac +SBFpassword: "" ## Inverter password +LocalBTAddress: "" # host BT mac - can be empty +SBFplantname: "" + +mariadb_pw: "" +mqtt_user: "" +mqtt_pass: "" + +home_lat: "" +home_long: "" +Timezone: "" + ### IF YOU WANT TO SKIP PVoutput +pvoSID: "0123456789:12345" ### will default to fake if left empty +pvoAPIkey: "fake9364fake4545afke834fake" ### will default to fake if left empty +``` + +The above options are the only required options if you want to fill out the options manually. + +### The rest of the options default to standard HAOS server addresses and SBFspot defaults + +
OPTIONS Image +

+ +![screenshot](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/UIoptions.PNG) + +

+
+ +

+ +## MQTT + +### 2022.9.1+ + +#### Add MQTT mqtt user and password to options. + +The other options default automatically if blank. +If you need to change the broker address, you can stil use the options. + +#### HA Sensor Generation + +
MQTT Sensor list +

+ +Description available in the SBFspot config file. + +[Default SBFspot CFG](https://raw.githubusercontent.com/habuild/hassio-addons/2022.9.1/haos-sbfspot/rootfs/usr/bin/sbfspot/SBFspot.default.cfg) + +* +Default list of Sensors for MQTT_Data + +``` +Timestamp,SunRise,SunSet,InvSerial,InvName,InvTime,InvStatus,InvSwVer,InvClass,InvType,InvTemperature,OperTm,FeedTm,EToday,ETotal,GridFreq,PACTot,PAC1,UAC1,IAC1,PDCTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2,BTSignal +``` + +* +Current available list of sensors (There are some new ones, which are not available yet) + +``` +Timestamp,InvTime,SunRise,SunSet,InvSerial,InvName,InvClass,InvType,InvSwVer,InvStatus,InvTemperature,InvGridRelay,EToday,ETotal,PDCTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2,OperTm,FeedTm,PACTot,PAC1,PAC2,PAC3,UAC1,UAC2,UAC3,IAC1,IAC2,IAC3,GridFreq,BTSignal,BatTmpVal,BatVol,BatAmp,BatChaStt +``` + +* +Sensors to be added at a later date + +``` +PrgVersion,InvWakeupTm,InvSleepTm,MeteringWOut,MeteringWIn,MeteringWTot +``` + +[MASTER SBFspot CFG](https://raw.githubusercontent.com/SBFspot/SBFspot/master/SBFspot/SBFspot.cfg) + +

+
+ +
MQTT Image +

+ +![screenshot](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/mqttcap.PNG) + +

+
+ +It is advised to **backup and/or disable existing yaml sensors** to avoid naming conflicts. + +#### Autogen Sensors - No, Create, Purge, options + +
No sensors. HAOS-SBFspot will run without generating sensors. It will use yaml or mqtt sensors. +

+

+
+ +
Create sensors. HAOS-SBFspot will automatically create sensors in the MQTT Integration. +

+ +[MQTT Integration](https://www.home-assistant.io/integrations/mqtt) + +It is advised to **backup and/or disable existing yaml sensors** to avoid naming conflicts. + + - This option will create topics using your plantname and inverter serial number + + - homeassistant/sensor/sbfspot_{*Your Plantname*}/sbf_spot{*your inv serial*}{*SensorType*}/config + + - homeassistant/sbfspot_{Your Plantname}/sbf_spot{Your Inv Serial} is the state_topic + +

+
+ +
Purge sensors. HAOS-SBFspot will send empty topics to your broker address to clear Retained topics. +

+ +- This will fail if you change topics between creating and purging sensors. +- You can use MQTT explorer or similar MQTT tool to manually remove the topics if this occurs. + +

+
+ +
Earlier versions and yaml mqtt sensors +

+ +### Prior to 2022.9.1 + +[haos-sbfspot_sensors.yaml](https://github.com/habuild/hassio-addons/blob/main/.images/sbfspot_sensors.yaml) I use packages to include these yaml sensors. You will need to change to match your plant name and serial as you have set in the add-on configuration options. + +**MQTT options argument** [configuration options](https://github.com/habuild/hassio-addons/blob/main/.images/Example_Config.yaml) The MQTT Username, and Password need to be hardcoded into the **MQTT_PublisherArgs:** The **{host}** **{topic}** and **{{message}}** will be picked up from options. + +**MQTT_PublisherArgs:** **'-h {host} -u Your_MQTT_Username -P Your_MQTT_password -t {topic} -m "{{message}}" -d -r'** + + Publisher arguments has been removed to allow for sensors + +**-d** is for MQTT debug in log. Which is helpful for confirming the MQTT messages are actually being sent. + +**-r** is to retain messages. it is advised against using retain flag + +

+
+

+ +## MariaDB + ### Initial database creation. Download and import either [No Drop DB create](https://github.com/habuild/hassio-addons/blob/main/.images/CreateMySQLDB_no_drop.sql) **or** [Create My SQL.sql](https://github.com/SBFspot/SBFspot/blob/master/SBFspot/CreateMySQLDB.sql) in [phpMyAdmin](https://github.com/hassio-addons/addon-phpmyadmin) to create your database. **IF** you haven't already created the database previously, use the NO Drop version. You will also need to add the Database and User/Password to MariaDB and allocate the port. ![screenshot](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/MariaDB%20setup.PNG) -### MQTT +

-[haos-sbfspot_sensors.yaml](https://github.com/habuild/hassio-addons/blob/main/.images/sbfspot_sensors.yaml) I use packages to include these yaml sensors. You will need to change to match your plant name and serial as you have set in the add-on configuration options. +## Container Data paths -**MQTT options argument** [configuration options](https://github.com/habuild/hassio-addons/blob/main/.images/Example_Config.yaml). The MQTT Username, and Password need to be hardcoded into the **MQTT_PublisherArgs:** The **{host}** **{topic}** and **{{message}}** will be picked up from options. +In HAOS (home assistant operating system) the /data/ path arrives at `/mnt/data/supervisor/addons/data/{slug_haos-sbfspot}` on the host. -**MQTT_PublisherArgs:** **'-h {host} -u Your_MQTT_Username -P Your_MQTT_password -t {topic} -m "{{message}}" -d -r'** +In docker/supervisor the /data/ path arrives at `/usr/share/hassio/addons/data/{slug_haos-sbfspot}` on the host. -**-d** is for MQTT debug in log. Which is helpful for confirming the MQTT messages are actually being sent. - -**-r** is to retain messages. it is advised against using retain flag - -### Example Configuration Options. - -can be copy/pasted as [Example Config](https://github.com/habuild/hassio-addons/blob/main/haos-sbfspot/.images/Example_Config.yaml) or entered via UI -![Example Options](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/Example_config_png.PNG) - -### Data paths - -In HAOS (home assistant operating system) the /data/ path arrives at /mnt/data/supervisor/addons/data/{slug}\_haos-sbfspot on the host. - -### Upload logs - -Logs delete after 3 days now. You would need SSH with Root host access to find them anyway. - -### **Link to haos-sbfspot Documentation** +## **Link to official SBFspot Documentation** Refer to the [SBFspot Wiki](https://github.com/sbfspot/sbfspot/wiki) for documentation and FAQ about SBFspot. ### **Special thanks to:** -- LauR3y/hassio-addons-addons which this version is cleaned up from. - The sbfspot team for SPFspot. ![Supports aarch64 Architecture][aarch64-shield] diff --git a/haos-sbfspot/Dockerfile b/haos-sbfspot/Dockerfile index d42d55f..d109d2e 100644 --- a/haos-sbfspot/Dockerfile +++ b/haos-sbfspot/Dockerfile @@ -18,7 +18,7 @@ RUN apk update && apk add --no-cache \ bluez=5.65-r0 \ bluez-dev=5.65-r0 \ boost-dev=1.78.0-r1 \ - curl-dev=7.83.1-r2 \ + curl-dev=7.83.1-r3 \ git=2.36.2-r0 \ g++=11.2.1_git20220219-r2 \ make=4.3-r0 \ @@ -82,8 +82,8 @@ COPY --from=builder-base /tmp/SBFspot/TagList* /usr/bin/sbfspot/ COPY rootfs / -RUN chmod a+x /etc/services.d/sbfspot/run /etc/services.d/sbfspot/finish /usr/bin/sbfspot/taillog.sh /usr/bin/sbfspot/generateConfig.sh /usr/bin/sbfspot/genBluetoothConfig.sh /usr/bin/sbfspot/genEthernetConfig.sh /usr/bin/sbfspot/SBFspot /usr/bin/sbfspot/SBFspotUploadDaemon /usr/bin/sbfspot/SBFspot.default.cfg /usr/bin/sbfspot/SBFspotUpload.default.cfg - +RUN chmod a+x /etc/services.d/sbfspot/** /usr/bin/sbfspot/** + # --- install cron --- # set shell RUN echo 'SHELL=/bin/bash' > /etc/crontabs/root @@ -95,8 +95,8 @@ RUN echo '*/5 6-22 * * * /usr/bin/sbfspot/SBFspot -v -ad1 -am0 -ae0 -mqtt > / RUN echo '55 05 * * * /usr/bin/sbfspot/SBFspot -v -sp0 -ad0 -am1 -ae1 -finq > /dev/stdout' >> /etc/crontabs/root # start SBFspotUpload 1 min after boot RUN echo '@reboot sleep 60 && /usr/bin/sbfspot/SBFspotUploadDaemon -c /usr/bin/sbfspot/SBFspotUpload.cfg > /dev/stdout' >> /etc/crontabs/root -# Log SBFspotUpload to HA logging window -RUN echo '*/5 6-22 * * * /usr/bin/sbfspot/taillog.sh > /dev/stdout' >> /etc/crontabs/root +# Log SBFspotUpload to HA logging window defunct now in version 3.9.6+ sbfspot, using it for the timed message +RUN echo '*/5 6-22 * * * /usr/bin/sbfspot/taillog.sh' >> /etc/crontabs/root # Labels LABEL \ diff --git a/haos-sbfspot/README.md b/haos-sbfspot/README.md index da6c2d6..01a1ad3 100644 --- a/haos-sbfspot/README.md +++ b/haos-sbfspot/README.md @@ -1,3 +1,5 @@ +--- + # SBFspot addon for HAOS ![Version](https://img.shields.io/badge/dynamic/yaml?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Fhabuild%2Fhassio-addons%2Fmain%2Fhaos-sbfspot%2Fconfig.yaml) @@ -10,7 +12,7 @@ [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fhabuild%2Fhassio-addons) -This [home assistant](https://www.home-assistant.io/getting-started/) add-on provides a wrapper for the **Bluetooth** version of [SBFspot 3.9.5](https://github.com/SBFspot/SBFspot/releases/latest). +This [home assistant](https://www.home-assistant.io/getting-started/) add-on provides a wrapper for the **Bluetooth** version of [SBFspot 3.9.6](https://github.com/SBFspot/SBFspot/releases/latest). This add-on runs a crontab service for SBFspot and SPFspotUploader at 5 minutely daytime interval. @@ -24,44 +26,180 @@ This add-on runs a crontab service for SBFspot and SPFspotUploader at 5 minutely ## Installation +--- + +### Options and Secrets + +If you want to template your options with secrets, the below template can be used. + +These names auto default so you shouldn't need to confirm(save) any options on installation + +It should all just default when starting the addon. + +``` +##template for secrets.yaml +## a restart might be required after Saving your secrets file + +BTAddress: "" ## Inverter BT mac +SBFpassword: "" ## Inverter password +LocalBTAddress: "" # host BT mac - can be empty +SBFplantname: "" + +mariadb_pw: "" +mqtt_user: "" +mqtt_pass: "" + +home_lat: "" +home_long: "" +Timezone: "" + ### IF YOU WANT TO SKIP PVoutput +pvoSID: "0123456789:12345" ### will default to fake if left empty +pvoAPIkey: "fake9364fake4545afke834fake" ### will default to fake if left empty +``` + +The above options are the only required options if you want to fill out the options manually. + +### The rest of the options default to standard HAOS server addresses and SBFspot defaults + +
OPTIONS Image +

+ +![screenshot](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/UIoptions.PNG) + +

+
+ +

+ +## MQTT + +### 2022.9.1+ + +#### Add MQTT mqtt user and password to options. + +The other options default automatically if blank. +If you need to change the broker address, you can stil use the options. + +#### HA Sensor Generation + +
MQTT Sensor list +

+ +Description available in the SBFspot config file. + +[Default SBFspot CFG](https://raw.githubusercontent.com/habuild/hassio-addons/2022.9.1/haos-sbfspot/rootfs/usr/bin/sbfspot/SBFspot.default.cfg) + +* +Default list of Sensors for MQTT_Data + +``` +Timestamp,SunRise,SunSet,InvSerial,InvName,InvTime,InvStatus,InvSwVer,InvClass,InvType,InvTemperature,OperTm,FeedTm,EToday,ETotal,GridFreq,PACTot,PAC1,UAC1,IAC1,PDCTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2,BTSignal +``` + +* +Current available list of sensors (There are some new ones, which are not available yet) + +``` +Timestamp,InvTime,SunRise,SunSet,InvSerial,InvName,InvClass,InvType,InvSwVer,InvStatus,InvTemperature,InvGridRelay,EToday,ETotal,PDCTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2,OperTm,FeedTm,PACTot,PAC1,PAC2,PAC3,UAC1,UAC2,UAC3,IAC1,IAC2,IAC3,GridFreq,BTSignal,BatTmpVal,BatVol,BatAmp,BatChaStt +``` + +* +Sensors to be added at a later date + +``` +PrgVersion,InvWakeupTm,InvSleepTm,MeteringWOut,MeteringWIn,MeteringWTot +``` + +[MASTER SBFspot CFG](https://raw.githubusercontent.com/SBFspot/SBFspot/master/SBFspot/SBFspot.cfg) + +

+
+ +
MQTT Image +

+ +![screenshot](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/mqttcap.PNG) + +

+
+ +It is advised to **backup and/or disable existing yaml sensors** to avoid naming conflicts. + +#### Autogen Sensors - No, Create, Purge, options + +
No sensors. HAOS-SBFspot will run without generating sensors. It will use yaml or mqtt sensors. +

+

+
+ +
Create sensors. HAOS-SBFspot will automatically create sensors in the MQTT Integration. +

+ +[MQTT Integration](https://www.home-assistant.io/integrations/mqtt) + +It is advised to **backup and/or disable existing yaml sensors** to avoid naming conflicts. + + - This option will create topics using your plantname and inverter serial number + + - homeassistant/sensor/sbfspot_{*Your Plantname*}/sbf_spot{*your inv serial*}{*SensorType*}/config + + - homeassistant/sbfspot_{Your Plantname}/sbf_spot{Your Inv Serial} is the state_topic + +

+
+ +
Purge sensors. HAOS-SBFspot will send empty topics to your broker address to clear Retained topics. +

+ +- This will fail if you change topics between creating and purging sensors. +- You can use MQTT explorer or similar MQTT tool to manually remove the topics if this occurs. + +

+
+ +
Earlier versions and yaml mqtt sensors +

+ +### Prior to 2022.9.1 + +[haos-sbfspot_sensors.yaml](https://github.com/habuild/hassio-addons/blob/main/.images/sbfspot_sensors.yaml) I use packages to include these yaml sensors. You will need to change to match your plant name and serial as you have set in the add-on configuration options. + +**MQTT options argument** [configuration options](https://github.com/habuild/hassio-addons/blob/main/.images/Example_Config.yaml) The MQTT Username, and Password need to be hardcoded into the **MQTT_PublisherArgs:** The **{host}** **{topic}** and **{{message}}** will be picked up from options. + +**MQTT_PublisherArgs:** **'-h {host} -u Your_MQTT_Username -P Your_MQTT_password -t {topic} -m "{{message}}" -d -r'** + + Publisher arguments has been removed to allow for sensors + +**-d** is for MQTT debug in log. Which is helpful for confirming the MQTT messages are actually being sent. + +**-r** is to retain messages. it is advised against using retain flag + +

+
+

+ +## MariaDB + ### Initial database creation. Download and import either [No Drop DB create](https://github.com/habuild/hassio-addons/blob/main/.images/CreateMySQLDB_no_drop.sql) **or** [Create My SQL.sql](https://github.com/SBFspot/SBFspot/blob/master/SBFspot/CreateMySQLDB.sql) in [phpMyAdmin](https://github.com/hassio-addons/addon-phpmyadmin) to create your database. **IF** you haven't already created the database previously, use the NO Drop version. You will also need to add the Database and User/Password to MariaDB and allocate the port. ![screenshot](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/MariaDB%20setup.PNG) -### MQTT +

-[haos-sbfspot_sensors.yaml](https://github.com/habuild/hassio-addons/blob/main/.images/sbfspot_sensors.yaml) I use packages to include these yaml sensors. You will need to change to match your plant name and serial as you have set in the add-on configuration options. +## Container Data paths -**MQTT options argument** [configuration options](https://github.com/habuild/hassio-addons/blob/main/.images/Example_Config.yaml). The MQTT Username, and Password need to be hardcoded into the **MQTT_PublisherArgs:** The **{host}** **{topic}** and **{{message}}** will be picked up from options. +In HAOS (home assistant operating system) the /data/ path arrives at `/mnt/data/supervisor/addons/data/{slug_haos-sbfspot}` on the host. -**MQTT_PublisherArgs:** **'-h {host} -u Your_MQTT_Username -P Your_MQTT_password -t {topic} -m "{{message}}" -d -r'** +In docker/supervisor the /data/ path arrives at `/usr/share/hassio/addons/data/{slug_haos-sbfspot}` on the host. -**-d** is for MQTT debug in log. Which is helpful for confirming the MQTT messages are actually being sent. - -**-r** is to retain messages. it is advised against using retain flag - -### Example Configuration Options. - -can be copy/pasted as [Example Config](https://github.com/habuild/hassio-addons/blob/main/haos-sbfspot/.images/Example_Config.yaml) or entered via UI -![Example Options](https://raw.githubusercontent.com/habuild/hassio-addons/main/.images/Example_config_png.PNG) - -### Data paths - -In HAOS (home assistant operating system) the /data/ path arrives at /mnt/data/supervisor/addons/data/{slug}\_haos-sbfspot on the host. - -### Upload logs - -Logs delete after 3 days now. You would need SSH with Root host access to find them anyway. - -### **Link to haos-sbfspot Documentation** +## **Link to official SBFspot Documentation** Refer to the [SBFspot Wiki](https://github.com/sbfspot/sbfspot/wiki) for documentation and FAQ about SBFspot. ### **Special thanks to:** -- LauR3y/hassio-addons-addons which this version is cleaned up from. - The sbfspot team for SPFspot. ![Supports aarch64 Architecture][aarch64-shield] diff --git a/haos-sbfspot/config.yaml b/haos-sbfspot/config.yaml index 7822fc0..247404a 100644 --- a/haos-sbfspot/config.yaml +++ b/haos-sbfspot/config.yaml @@ -1,16 +1,19 @@ --- name: HAOS-SBFspot -version: 2022.8.4 +version: 2022.9.1 slug: haos-sbfspot description: Manage SBFspot with a simple interface url: "https://github.com/habuild/hassio-addons/tree/main/haos-sbfspot" stage: experimental +image: "ghcr.io/habuild/{arch}-addon-haos-sbfspot" arch: - armhf - armv7 - aarch64 - amd64 init: false +host_network: true +host_dbus: true homeassistant_api: true panel_icon: mdi:solar-power-variant services: @@ -18,76 +21,48 @@ services: - mqtt:want options: Connection_Type: "Bluetooth" - BTAddress: "" - Password: "0000" - LocalBTAddress: "00:00:00:00:00:00" + Sensors_HA: No + BTAddress: "!secret BTAddress" + Password: "!secret SBFpassword" + LocalBTAddress: "!secret LocalBTAddress" IP_Address: "255.255.255.255" - MIS_Enabled: 0 - Plantname: MyPlant - OutputPath: /data/sbfspot/%Y - OutputPathEvents: /data/sbfspot/%Y/events - Latitude: "null" - Longitude: "null" - CalculateMissingSpotValues: 1 - DateTimeFormat: "%d/%m/%Y %H:%M:%S" - DateFormat: "%d/%m/%Y" - DecimalPoint: comma - TimeFormat: "%H:%M:%S" - SynchTime: 0 - SynchTimeLow: 1 - SynchTimeHigh: 3600 - SunRSOffset: 900 - Locale: en-US - Timezone: Europe/Brussels - BTConnectRetries: 10 - CSV_Export: 0 - CSV_ExtendedHeader: 1 - CSV_Header: 1 - CSV_SaveZeroPower: 1 - CSV_Delimiter: semicolon - CSV_Spot_TimeSource: Inverter - CSV_Spot_WebboxHeader: 0 - SQL_Database: "SBFspot" - SQL_Hostname: core-mariadb - SQL_Port: "3306" - SQL_Username: "sbfspot" - SQL_Password: "" - MQTT_Publisher: /usr/bin/mosquitto_pub - MQTT_Host: core-mosquitto - MQTT_Port: "1883" + Plantname: "!secret SBFplantname" + Latitude: "!secret home_lat" + Longitude: "!secret home_long" + Timezone: "!secret Timezone" + DateTimeFormat: "'%H:%M:%S %d-%m-%y'" + SQL_Password: "!secret mariadb_pw" + MQTT_User: "!secret mqtt_user" + MQTT_Pass: "!secret mqtt_pass" MQTT_Topic: "homeassistant/sbfspot_{plantname}/sbfspot_{serial}" - MQTT_ItemFormat: '"{key}": {value}' - MQTT_ItemDelimiter: comma - MQTT_PublisherArgs: >- - -h {host} -u MQTT_Username -P MQTT_Password -t {topic} -m "{{message}}" -d MQTT_Data: >- - Timestamp,SunRise,SunSet,InvSerial,InvName,InvTime,InvStatus,InvTemperature,InvGridRelay,EToday,ETotal,GridFreq,PACTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2 - PVoutput_SID: "0123456789:12345" - PVoutput_Key: "fake9364fake4545fake834fake" - LogDir: /data/sbfspot/log/ + Timestamp,SunRise,SunSet,InvSerial,InvName,InvTime,InvStatus,InvSwVer,InvClass,InvType,InvTemperature,OperTm,FeedTm,EToday,ETotal,GridFreq,PACTot,PAC1,UAC1,IAC1,PDCTot,UDC1,UDC2,IDC1,IDC2,PDC1,PDC2,BTSignal + PVoutput_SID: "!secret pvoSID" + PVoutput_Key: "!secret pvoAPIkey" LogLevel: info schema: Connection_Type: list(Bluetooth|Ethernet)? + Sensors_HA: list(No||Create||Purge|)? BTAddress: "str" - Password: "str" - LocalBTAddress: "str" - IP_Address: "str" + Password: "password" + LocalBTAddress: "str?" + IP_Address: "str?" Plantname: "str" MIS_Enabled: "int?" OutputPath: "str?" OutputPathEvents: "str?" - Latitude: "float" - Longitude: "float" - Timezone: "str" - DateTimeFormat: "str" - DateFormat: "str" - DecimalPoint: "str" - TimeFormat: "str" + Latitude: "str?" + Longitude: "str?" + Timezone: "str?" + DateTimeFormat: "str?" + DateFormat: "str?" + DecimalPoint: "str?" + TimeFormat: "str?" SynchTime: "int?" SynchTimeLow: "int?" SynchTimeHigh: "int?" SunRSOffset: "int?" - Locale: "str" + Locale: "str?" CalculateMissingSpotValues: "int?" BTConnectRetries: "int?" CSV_Export: "int?" @@ -101,19 +76,17 @@ schema: SQL_Hostname: "str?" SQL_Port: "str?" SQL_Username: "str?" - SQL_Password: "str?" + SQL_Password: "password?" MQTT_Publisher: "str?" - MQTT_Host: "str" - MQTT_Port: "str" + MQTT_Host: "str?" + MQTT_Port: "str?" + MQTT_User: "str" + MQTT_Pass: "password" MQTT_Topic: "str" - MQTT_ItemFormat: "str" - MQTT_ItemDelimiter: str - MQTT_PublisherArgs: str + MQTT_ItemFormat: "str?" + MQTT_ItemDelimiter: str? + MQTT_PublisherArgs: str? MQTT_Data: "str" - PVoutput_SID: "str" - PVoutput_Key: "str" - LogDir: "str?" - LogLevel: "str" -host_network: true -host_dbus: true -image: "ghcr.io/habuild/{arch}-addon-haos-sbfspot" + PVoutput_SID: "password?" + PVoutput_Key: "password?" + LogLevel: list(debug|info||warning||error)? diff --git a/haos-sbfspot/rootfs/etc/nanorc b/haos-sbfspot/rootfs/etc/nanorc new file mode 100644 index 0000000..e46abdf --- /dev/null +++ b/haos-sbfspot/rootfs/etc/nanorc @@ -0,0 +1,295 @@ +## Sample initialization file for GNU nano. +## +## For the options that take parameters, the default value is shown. +## Other options are unset by default. To make sure that an option +## is disabled, you can use "unset