├── LICENSE ├── Makefile ├── README.md ├── man └── man1 │ └── mi600.1 └── mi600 /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 dr-ni 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | INSTALL?=install 2 | RM?=rm -f 3 | CP?=cp 4 | RMD?=$(RM) -r 5 | PREFIX?=/usr/local 6 | BIN=bin 7 | DOCS=/usr/share/doc/mi600 8 | MANS=man/man1 9 | all: 10 | @echo "usage:" 11 | @echo " sudo make install" 12 | @echo " sudo make uninstall" 13 | 14 | install: 15 | $(INSTALL) -d $(PREFIX)/$(MANS) 16 | $(INSTALL) -m 0755 mi600 $(PREFIX)/$(BIN) 17 | $(INSTALL) -m 0644 README.md $(DOCS) 18 | $(INSTALL) -m 0644 LICENSE $(DOCS) 19 | $(INSTALL) -m 0644 $(MANS)/mi600.1 $(PREFIX)/$(MANS) 20 | 21 | uninstall: 22 | $(RM) $(PREFIX)/$(BIN)/mi600 23 | $(RMD) $(DOCS) 24 | $(RM) $(PREFIX)/$(MANS)/mi600.1 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mi600 2 | 3 | This is a simple bash command-line tool for direct solar data requests to the Bosswerk MI600, MI300 and similar inverters like the deye Sun-600G3 inverters. It can read the actual solar power, cumulative daily earned energy and many other inverter informations. 4 | 5 | ## Requirements 6 | 7 | - curl must be installed. 8 | - bc must be installed. 9 | - awk must be installed. 10 | 11 | ## Development 12 | 13 | 14 | Install: 15 | ```sh 16 | sudo make install 17 | ``` 18 | 19 | Uninstall: 20 | ```sh 21 | sudo make uninstall 22 | ``` 23 | 24 | ## Usage 25 | ``` 26 | mi600 [] [-u] 27 | Option '-u': show unit 28 | ``` 29 | 30 | By default the username and password are `admin` and `admin`. 31 | 32 | ### Option 'type': 33 | - webdata_sn 34 | - webdata_msvn 35 | - webdata_ssvn 36 | - webdata_pv_type 37 | - webdata_rate_p 38 | - webdata_now_p 39 | - webdata_today_e 40 | - webdata_total_e 41 | - webdata_alarm 42 | - webdata_utime 43 | - cover_mid 44 | - cover_ver 45 | - cover_wmode 46 | - cover_ap_ssid 47 | - cover_ap_ip 48 | - cover_ap_mac 49 | - cover_sta_ssid 50 | - cover_sta_rssi 51 | - cover_sta_ip 52 | - cover_sta_mac 53 | - status_a 54 | - status_b 55 | - status_c 56 | 57 | 58 | https://github.com/dr-ni/mi600 59 | -------------------------------------------------------------------------------- /man/man1/mi600.1: -------------------------------------------------------------------------------- 1 | .TH "mi600" 1 1.0.2 "12 Feb 2023" "User Manual" 2 | 3 | .SH NAME 4 | mi600 5 | 6 | .SH DESCRIPTION 7 | This is a simple bash command-line tool for direct solar data requests to the Bosswerk MI600 solar inverter. It can read the actual solar power, cumulative daily earned energy and many other inverter informations. 8 | 9 | .SH SYNOPSIS 10 | mi600 [] [-u] 11 | 12 | Option '-u': show unit 13 | 14 | .TP 15 | Option 'type': 16 | webdata_sn 17 | webdata_msvn 18 | webdata_ssvn 19 | webdata_pv_type 20 | webdata_rate_p 21 | webdata_now_p 22 | webdata_today_e 23 | webdata_total_e 24 | webdata_alarm 25 | webdata_utime 26 | cover_mid 27 | cover_ver 28 | cover_wmode 29 | cover_ap_ssid 30 | cover_ap_ip 31 | cover_ap_mac 32 | cover_sta_ssid 33 | cover_sta_rssi 34 | cover_sta_ip 35 | cover_sta_mac 36 | status_a 37 | status_b 38 | status_c 39 | 40 | .SH COPYRIGHT 41 | MIT License 42 | 43 | Copyright (c) 2022 dr-ni 44 | 45 | Permission is hereby granted, free of charge, to any person obtaining a copy 46 | of this software and associated documentation files (the "Software"), to deal 47 | in the Software without restriction, including without limitation the rights 48 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 49 | copies of the Software, and to permit persons to whom the Software is 50 | furnished to do so, subject to the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be included in all 53 | copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 56 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 57 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 58 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 59 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 60 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 61 | SOFTWARE. 62 | 63 | .SH CONTACT 64 | Website: https://github.com/dr-ni/mi600 65 | 66 | -------------------------------------------------------------------------------- /mi600: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # mi600 4 | # MIT License Copyright (c) 2022 dr-ni 5 | # https://github.com/dr-ni/mi600 6 | # 7 | # A simple bash command-line tool for direct solar data requests 8 | # to the inverter Bosswerk mi600. 9 | # It can read the actual solar power and the cumulative daily earned energy. 10 | # 11 | # Requirements: curl must be installed. 12 | # 13 | # 14 | host=$1 15 | auth=$2:$3 16 | dat=webdata_now_p 17 | val='' 18 | 19 | # option check 20 | if [ $# -lt 3 ] 21 | then 22 | echo "Usage: $0 [] [-u]" 23 | echo "Valid types can be found in man page: 'man mi600'" 24 | echo "Option '-u': show unit" 25 | exit 1 26 | fi 27 | if [ $# -gt 3 ] 28 | then 29 | if [ "$4" == "-u" ] 30 | then 31 | dat=webdata_now_p 32 | val=W 33 | else 34 | dat=$4 35 | val='' 36 | if [ "$5" == "-u" ] 37 | then 38 | [ "$dat" = "webdata_today_e" ] && val=kWh 39 | [ "$dat" = "webdata_total_e" ] && val=kWh 40 | [ "$dat" = "webdata_now_p" ] && val=W 41 | fi 42 | fi 43 | fi 44 | for i in 1 2 3 45 | do 46 | o=$(curl -s -u "$auth" "$host"/status.html | grep "$dat = " | awk -F '"' '{print $2}') 47 | if [ "$o" != "" ] 48 | then 49 | if [[ "$dat" == "webdata_total_e" || "$dat" == "webdata_today_e" ]] 50 | then 51 | p=$(echo "scale=1; $o/1.0" | bc | tr -d ' ') 52 | elif [ "$dat" == "webdata_now_p" ] 53 | then 54 | p=$(echo "$o" | tr -d ' ') 55 | else 56 | p=$(echo "$o") 57 | fi 58 | echo "$p $val" 59 | exit 0 60 | fi 61 | sleep 3 62 | done 63 | ping -c3 $host > /dev/null 2>&1 64 | if [ $? -eq 0 ] 65 | then 66 | echo "mi600: could not read value" 67 | else 68 | echo "Error: connection to $host failed" 69 | fi 70 | exit 1 71 | --------------------------------------------------------------------------------