Coder Social home page Coder Social logo

birdie1 / victron Goto Github PK

View Code? Open in Web Editor NEW
120.0 25.0 16.0 226 KB

Victron bluetooth and serial communication at a python script. With MQTT and HomeAssistant support.

License: GNU General Public License v3.0

Python 100.00%
victron victronconnect bluetooth serial solar solar-system battery-monitor mqtt homeassistant ble

victron's Introduction

VictronConnect Bluetooth & Serial

This repository is in no way approved by or affiliated with the official Victron Energy repository. I am not responsible for any problems or damages with your devices or this code

Only run this script if you are sure you know what you are doing!

This repository is based on https://github.com/vvvrrooomm/victron.

I use this repository to have a running version with mqtt for my camping car. If you want more information about the development and a wireshark dissector, refer to vvvrrooomm's repository.

New version for the new bluetooth gatt api used in the beta firmware of the SmartShunt

See https://community.victronenergy.com/questions/93919/victron-bluetooth-ble-protocol-publication.html for more information about how to activate the new gatt protocol with the beta firmware.

The Bluetooth-BLE (new gatt protocol) and the serial protocol works quiet stable. The normal bluetooth protocol is the hardest to implement. Many values are still missing.

More features will be added soon.

Ability of this repository

The script is tested with python > 3.7

Supported/tested devices:

Bluetooth BLE:

  • Smart Shunt

Bluetooth:

  • Smart Shunt
  • Smart Solar 100/30
  • Orion Smart 12/12-30

Serial:

  • Phoenix Inverter 12 800VA 230V
  • Smart Shunt
  • Smart Solar 100/30

Outputs (Single values or as collection of values)

  • mqtt
  • syslog
  • print
  • json

Autostart scripts (systemd)

These scripts are written for my specific config file. If you have your devices in different order, you may need to adjust them.

Howto use


NOTE

If you want the serial communication with the Phoenix Inverter, you must install this library:

There are some more commandline arguments, you can view them with python3 victron.py --help


  1. You need to install python3-dbus For debian based system: apt install python3-dbus For arch linux: pacman -S python-dbus
  2. You need to install some requirements: pip3 install -r requirements.txt
  3. Add your devices to the configuration file. See "Configuration in detail" section for examples.
  4. If you are using bluetooth or bluetooth ble you must be pairing your devices via bluetoothctl
    # Open bluetoothctl from commandline
    bluetoothctl
    
    # Enable scanning
    scan on
      
    # Get the mac address of your device
    # pair device and enter pin
    pair MAC
    
    
  5. Start the script for your desired device: python3 victron.py -d 0
  6. For autostart tweak systemd files to your need, link them to /etc/systemd/system/, then start and/or enable systemd file
    ln -s /opt/victron/systemd/victron-shunt.service /etc/systemd/system/victron-shunt.service
    
    systemctl enable victron-shunt.service
    systemctl start victron-shunt.service
    

Commandline arguments

./victron.py -h
usage: victron.py [-h] [--debug] [--quiet] [-c] [-C CONFIG_FILE] [-D] [-v] [-d NUM / NAME]

Victron Reader (Bluetooth, BLE and Serial) 

Current supported devices:
  Full: 
    - Smart Shunt (Bluetooth BLE)
    - Phoenix Inverter (Serial)
    - Smart Shunt (Serial)
    - Smart Solar (Serial)
    - Blue Solar (Serial)
  Partial: 
    - Smart Shunt (Bluetooth)
    - Smart Solar (Bluetooth)
    - Orion Smart (Bluetooth)
Default behavior:
  1. It will connect to given device
  2. Collect and log data summary as defined at the config file
  3. Disconnect and start over with timers set in config file

options:
  -h, --help            show this help message and exit

  --debug               Set log level to debug
  --quiet               Set log level to error

  -c, --collection      Output only collections specified in config instead of single values
  -C CONFIG_FILE, --config-file CONFIG_FILE
                        Specify different config file [Default: config.yml]
  -D, --direct-disconnect
                        Disconnect direct after getting values
  -v, --version         Show version and exit

  -d NUM / NAME, --device NUM / NAME
                        0: Shunt1 | 

Meta

-h / --help

Show help.

-v / --version

Show version.

Mandatory

-d / --device NUMBER|NAME

You need to specify the device from configuration which you want to connect to.

Optional

--debug / --info

Set log level.

-c / --collection

Define a collection to "merge" values in to one output instead of output every value separately. A collection must look like:

collections:
  DEVICENAME:
    COLLECTIONNAME:
      - VALUENAME
      - VALUENAME2

You need to set the DEVICENAME the same as your device. You can choose the COLLECTIONNAME freely, it will be used in json output as key. The VALUENAMES must match with the code, see config.yml for possible VALUENAMES and more examples.

-C / --config-file FILENAME

Specify a config file other than default (config.yml).

-D / --direct-disconnect

Default the program will not exit on its own. If you want to collect the values from a device and exit, use this option. Be aware, that it will act different on the different connection protocols.

serial / bluetooth-ble: It will exit after the first value. To get all values once, you need to specify a collection to exit after all values are returned.
bluetooth: It will exit after the auto disconnect of the device and return all values gathered until then.

FAQ

No output shown with following log message "merror: Not connected"

Please check if you paired the victron device correctly via bluetooth using bluetoothctl. If you changed the pin of the vicron device, delete and repair the device.

Configuration in detail

Device section

Mandatory: Name, Type, Protocol and (MAC or serialport) depending of the type. bluetooth and bluetooth-ble need to have the bluetooth mac adress of the victron device specified.
Name: Choose yourself
Type: phoenix, smartshunt, smartsolar, orionsmart
Protocol: serial, bluetooth, bluetooth-ble

    - name: Phoenix1
      type: phoenix
      protocol: serial
      port: /dev/victron-phoenix

or

    - name: Shunt1
      type: smartshunt
      protocol: bluetooth-ble
      mac: fd:d4:50:0f:6c:1b

or

    - name: Solar1
      type: smartsolar
      protocol: bluetooth
      mac: F9:8E:1C:EC:9C:72

Optional:

Output section

You can choose between:

logger: mqtt

or

logger: syslog

or

logger: print

or

logger: json

MQTT section

Choose host, port, base_topic and if you want to use HomeAssistant Discovery (Yet only supported on serial devices). SSL and authentication will be added later.

mqtt:
    host: 192.168.3.2
    port: 1883
    base_topic: victron
    hass: True

Collections section

You can specify if you want the values get summarized into one json output statement. Otherwise it will send out every value as soon as it is collected from victron device. See configfile for more information!

Known issues

  • The devices with bluetooth protocol are currently auto disconnecting after 30 seconds. This may prevent some values from being gathered.
  • Orion Smart must be more reverse engineered to get some more interesting values
  • Bluetooth: From smart solar you can't get the history values. The protocol itself is decoded (and working) for this part, but the smart solar doesn't send the data. I guess we need to send another init sequence. I didn't figure out the corrent sequence yet!
  • Serial: Smart Solar history currently not gathered

Feel free to help improving this repository.

Future plans:

  • Choose via config file which values should be printed
  • Choose how often values should be printed (especially bluettooth with notifications)
  • CMD Parameter instead of config (easier testing of new devices)
  • SmartSolar history values
  • Get device settings via serial and bluetooth
  • Add a config checker to avoid invalid config parameter

victron's People

Contributors

birdie1 avatar fti7 avatar gjedeer avatar oedo808 avatar vvvrrooomm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

victron's Issues

JSON output and single query?

Thanks for the brilliant work on this project. Pretty amazing what you have created so far.

I totally understand your approach of getting data in the MQTT. However, I would love to use it for single queries. So instead of running a delay and then query the device again, I would like to just quit the script. In addition I would love you you could do a JSON encoded output to stdout.

I'm not that familiar with Python, so not sure if I would be able to change the code accordingly (and pretty).

But is this anything which we could add to the project? Or would this be against the overall concept?

mqtt values not under topic

I just just got this project setup, thanks for making it by the way! Once it was connected to my smart solar 100/30 via vedirect and to my mqtt broker I noticed values being posted on the base of the mqtt broker and not under the topic I set. Is it suppose to do that? Seems like it would conflict when I add a smart shunt and it tries to post to the same base of the mqtt server and not its own sub-topic.

This is an image

P.S. Do you see any problem with setting time timer to 1 second repeat on serial? For more real time values.

P.P.S. I had to downgrade from newer version of python down to python 3.8.13 to get the project to work. Others might find that useful in the readme.

Why does it output few values ?

Hey @birdie1
your project is interesting and I'm using it with my Orion Smart and Smart solar devices via Bluetooth.

I'm sorry in advance if the questions may sound dumb but I'm new to working with bluetooth.

I used your same collection for the smart solar:
collections:
smartsolar:
device:
- Day sequence Number (0..364)
- Product ID
- Serial
- Firmware
- Production Date
latest:
- Voltage
- Current
- Voltage Panel
- SmartSolar Solar Voltage # added
- Power
- Status
- MPPT Tracker Operation Mode
- Off Reason
- Virtual Load Output
- Error Code
history:
- Energy All Time
- Energy Today
- Energy Today Max
- Energy Yesterday
- Energy Yesterday Max

But I only get this (when I run python victron.py -d 1)
Screenshot from 2021-09-18 00-03-56

This is my log (when I run python victron.py -d 1 -c --debug):

(.venv) rudloff@capsule:~/sources/CapsuleScripts/devices_driver/victron$ python victron.py -d 1 -c --debug
[INFO ] (2021-09-17 21:53:48,769) victron_bluetooth.py::213 SmartSolar: Connecting...
[INFO ] (2021-09-17 21:53:49,447) victron_gatt.py::50 SmartSolar: Connected!
[DEBUG ] (2021-09-17 21:53:49,608) victron_gatt.py::69 SmartSolar: [EF:7A:84:4F:EB:A1] Resolved services
[DEBUG ] (2021-09-17 21:53:49,611) victron_gatt.py::75 [EF:7A:84:4F:EB:A1] Service [306b0001-b081-4037-83dc-e59fcc3cdfd0] (vendor, smartsolar & BMV712 )
[DEBUG ] (2021-09-17 21:53:49,614) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [306b0004-b081-4037-83dc-e59fcc3cdfd0]
[DEBUG ] (2021-09-17 21:53:49,617) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [306b0003-b081-4037-83dc-e59fcc3cdfd0]
[DEBUG ] (2021-09-17 21:53:49,620) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [306b0002-b081-4037-83dc-e59fcc3cdfd0]
[DEBUG ] (2021-09-17 21:53:49,623) victron_gatt.py::75 [EF:7A:84:4F:EB:A1] Service [97580001-ddf1-48be-b73e-182664615d8e] (vendor, VE.Direct Smart)
[DEBUG ] (2021-09-17 21:53:49,626) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [97580006-ddf1-48be-b73e-182664615d8e]
[DEBUG ] (2021-09-17 21:53:49,628) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [97580004-ddf1-48be-b73e-182664615d8e]
[DEBUG ] (2021-09-17 21:53:49,631) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [97580003-ddf1-48be-b73e-182664615d8e]
[DEBUG ] (2021-09-17 21:53:49,633) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [97580002-ddf1-48be-b73e-182664615d8e]
[DEBUG ] (2021-09-17 21:53:49,636) victron_gatt.py::75 [EF:7A:84:4F:EB:A1] Service [68c10001-b17f-4d3a-a290-34ad6499937c] (vendor, VE.Direct Smart)
[DEBUG ] (2021-09-17 21:53:49,639) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [68c10003-b17f-4d3a-a290-34ad6499937c]
[DEBUG ] (2021-09-17 21:53:49,643) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [68c10002-b17f-4d3a-a290-34ad6499937c]
[DEBUG ] (2021-09-17 21:53:49,645) victron_gatt.py::75 [EF:7A:84:4F:EB:A1] Service [00001801-0000-1000-8000-00805f9b34fb] (generic attributes)
[DEBUG ] (2021-09-17 21:53:49,647) victron_gatt.py::77 [EF:7A:84:4F:EB:A1] Characteristic [00002a05-0000-1000-8000-00805f9b34fb]
[DEBUG ] (2021-09-17 21:53:49,649) victron_gatt.py::81 SmartSolar: Subscribe to notifications
[DEBUG ] (2021-09-17 21:53:49,650) victron_gatt.py::124 SmartSolar:subscribe notifications
[DEBUG ] (2021-09-17 21:53:49,651) victron_gatt.py::130 SmartSolar: notifications for 000c: 00002a05-0000-1000-8000-00805f9b34fb
[DEBUG ] (2021-09-17 21:53:49,652) victron_gatt.py::130 SmartSolar: notifications for 0010: 68c10002-b17f-4d3a-a290-34ad6499937c
[DEBUG ] (2021-09-17 21:53:49,653) victron_gatt.py::130 SmartSolar: notifications for 0013: 68c10003-b17f-4d3a-a290-34ad6499937c
[DEBUG ] (2021-09-17 21:53:49,654) victron_gatt.py::130 SmartSolar: notifications for 0016: 97580002-ddf1-48be-b73e-182664615d8e
[DEBUG ] (2021-09-17 21:53:49,656) victron_gatt.py::130 SmartSolar: notifications for 0018: 97580003-ddf1-48be-b73e-182664615d8e
[DEBUG ] (2021-09-17 21:53:49,656) victron_gatt.py::130 SmartSolar: notifications for 001b: 97580004-ddf1-48be-b73e-182664615d8e
[DEBUG ] (2021-09-17 21:53:49,657) victron_gatt.py::130 SmartSolar: notifications for 001d: 97580006-ddf1-48be-b73e-182664615d8e
[DEBUG ] (2021-09-17 21:53:49,658) victron_gatt.py::130 SmartSolar: notifications for 0021: 306b0002-b081-4037-83dc-e59fcc3cdfd0
[DEBUG ] (2021-09-17 21:53:49,659) victron_gatt.py::130 SmartSolar: notifications for 0024: 306b0003-b081-4037-83dc-e59fcc3cdfd0
[DEBUG ] (2021-09-17 21:53:49,660) victron_gatt.py::130 SmartSolar: notifications for 0027: 306b0004-b081-4037-83dc-e59fcc3cdfd0
[DEBUG ] (2021-09-17 21:53:49,661) victron_gatt.py::135 SmartSolar: enable notifications done
[DEBUG ] (2021-09-17 21:53:51,665) victron_gatt.py::84 SmartSolar: Send init sequence
[DEBUG ] (2021-09-17 21:53:51,665) victron_gatt.py::160 SmartSolar: sending 0021, databytearray(b'\xfa\x80\xff')
[DEBUG ] (2021-09-17 21:53:52,673) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:52,676) victron_gatt.py::160 SmartSolar: sending 0021, databytearray(b'\xf9\x80')
[DEBUG ] (2021-09-17 21:53:53,682) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:53,685) victron_gatt.py::160 SmartSolar: sending 0024, databytearray(b'\x01')
[DEBUG ] (2021-09-17 21:53:54,702) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:54,714) victron_gatt.py::160 SmartSolar: sending 0024, databytearray(b'\x03\x00')
[DEBUG ] (2021-09-17 21:53:55,725) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\x02\x9f\x00\x00\x01\x00\x03\x01\xff' - value_origin:b'\x02\x9f\x00\x00\x01\x00\x03\x01\xff'
[DEBUG ] (2021-09-17 21:53:55,726) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\xf9\x01\xf9\x01' - value_origin:b'\xf9\x01\xf9\x01'
[DEBUG ] (2021-09-17 21:53:55,726) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:55,726) victron_gatt.py::160 SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'\x03\x01\x03\x03")
[DEBUG ] (2021-09-17 21:53:56,728) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\xf9\x01' - value_origin:b'\xf9\x01'
[DEBUG ] (2021-09-17 21:53:56,728) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\x07\x00\x03\x00' - value_origin:b'\x07\x00\x03\x00'
[DEBUG ] (2021-09-17 21:53:56,731) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:56,741) victron_gatt.py::160 SmartSolar: sending 0027, databytearray(b'\x05\x00\x81\x19\xec\x0f\x05\x00\x81\x19\xec\x0e\x05\x00\x81\x19\x01\x0c\x05\x00')
[DEBUG ] (2021-09-17 21:53:57,755) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\xf9\x01' - value_origin:b'\xf9\x01'
[DEBUG ] (2021-09-17 21:53:57,755) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b"\x08\x00\x18\x93B\x10'" - value_origin:b"\x08\x00\x18\x93B\x10'"
[DEBUG ] (2021-09-17 21:53:57,755) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\x07\x00\x03\x00\x07\x00\x03\x00' - value_origin:b'\x07\x00\x03\x00\x07\x00\x03\x00'
[DEBUG ] (2021-09-17 21:53:57,756) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:57,756) victron_gatt.py::160 SmartSolar: sending 0024, databytearray(b'\x81\x18\x90\x05\x00\x81\x19\xec?\x05\x00\x81\x19\xec\x12')
[DEBUG ] (2021-09-17 21:53:58,757) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:58,757) victron_gatt.py::160 SmartSolar: sending 0024, databytearray(b'\x19\xec\xdc\x05\x03\x81\x19\xec\xeb\x05\x03\x81\x19\xec\xed')
[DEBUG ] (2021-09-17 21:53:59,759) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\xf9\x01' - value_origin:b'\xf9\x01'
[DEBUG ] (2021-09-17 21:53:59,759) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\t\x00\x19\xec\x0f\x01': 'unknown command (in fixed len) 0x0'
[DEBUG ] (2021-09-17 21:53:59,760) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\t\x00\x19\xec\x0e\x01': 'unknown command (in fixed len) 0x0'
[DEBUG ] (2021-09-17 21:53:59,760) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\t\x00\x19\x01\x0c\x01': 'unknown command (in fixed len) 0x0'
[DEBUG ] (2021-09-17 21:53:59,760) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\t\x00\x18\x90\x01' - value_origin:b'\t\x00\x18\x90\x01'
[DEBUG ] (2021-09-17 21:53:59,760) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\x08\x00\x19\xec?A\x01': 'unknown command (in var len) 0x3f in dict_keys([140, 141, 142, 125, 143, 188, 189, 187, 239, 240, 246])'
[DEBUG ] (2021-09-17 21:53:59,761) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\x08\x00\x19\xec\x12B\xff\xff': 'unknown command (in var len) 0x12 in dict_keys([140, 141, 142, 125, 143, 188, 189, 187, 239, 240, 246])'
[DEBUG ] (2021-09-17 21:53:59,761) victron_bluetooth.py::353 SmartSolar: Collected SmartSolar Solar Voltage -> 0.03
[DEBUG ] (2021-09-17 21:53:59,761) victron.py::82 SmartSolar: SmartSolar Solar Voltage not in any collections, it will never be published
[DEBUG ] (2021-09-17 21:53:59,761) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:53:59,761) victron_gatt.py::160 SmartSolar: sending 0021, databytearray(b'\xf9A')
[DEBUG ] (2021-09-17 21:54:00,763) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\xf9\x01' - value_origin:b'\xf9\x01'
[DEBUG ] (2021-09-17 21:54:00,763) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\xf7\x03\x00' - value_origin:b'\xf7\x03\x00'
[DEBUG ] (2021-09-17 21:54:00,764) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\t\x03\x19\xec\xeb\x01': 'unknown command (in fixed len) 0x0'
[DEBUG ] (2021-09-17 21:54:00,764) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\t\x03\x19\xec\xed\x01': 'unknown command (in fixed len) 0x0'
[DEBUG ] (2021-09-17 21:54:00,764) victron_bluetooth.py::353 SmartSolar: Collected SmartSolar Solar Voltage -> 0.01
[DEBUG ] (2021-09-17 21:54:00,764) victron.py::82 SmartSolar: SmartSolar Solar Voltage not in any collections, it will never be published
[DEBUG ] (2021-09-17 21:54:00,765) victron_bluetooth.py::353 SmartSolar: Collected Identify -> normal operation (default)
[DEBUG ] (2021-09-17 21:54:00,765) victron.py::82 SmartSolar: Identify not in any collections, it will never be published
[DEBUG ] (2021-09-17 21:54:00,765) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:54:00,765) victron_gatt.py::160 SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'")
[DEBUG ] (2021-09-17 21:54:01,769) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
[DEBUG ] (2021-09-17 21:54:01,770) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
[DEBUG ] (2021-09-17 21:54:01,770) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:54:01,770) victron_gatt.py::160 SmartSolar: sending 0021, databytearray(b'\xf9A')
[DEBUG ] (2021-09-17 21:54:02,773) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\xf9\x01' - value_origin:b'\xf9\x01'
[DEBUG ] (2021-09-17 21:54:02,773) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b"\x08\x00\x18\x93B\x10'" - value_origin:b"\x08\x00\x18\x93B\x10'"
[DEBUG ] (2021-09-17 21:54:02,774) victron_gatt.py::96 SmartSolar: write succeeded
[DEBUG ] (2021-09-17 21:54:03,479) victron_bluetooth.py::244 UNRECOGNIZED DATA: SmartSolar: unknown single packet: value:b'\x08\x03\x18\x90A\x01' - value_origin:b'\x08\x03\x18\x90A\x01'
[DEBUG ] (2021-09-17 21:54:03,494) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\x08\x03\x19\x01PD\x01\x00\x00\x00': index out of range
[DEBUG ] (2021-09-17 21:54:05,804) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
[DEBUG ] (2021-09-17 21:54:05,819) victron_gatt.py::117 UNRECOGNIZED DATA: SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
[INFO ] (2021-09-17 21:54:10,789) victron_gatt.py::63 SmartSolar: Disconnected!

D-bus error

Looking for some advice. I managed to set up the connection to a SmartSolar 250/70. It was working fine for a week or two, sending data to a MQTT logger. A couple of days ago it stopped working, and is throwing two different errors in the log:

It either fails to connect with this error:

[ERROR  ] (2022-06-05 10:36:46,588) victron_gatt.py::56 smartsolar1: Connection failed: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.!

Or it connects and then throws this one:

[ERROR  ] (2022-06-05 10:01:24,054) connection.py::236 Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/dbus/connection.py", line 232, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/gatt/gatt_linux.py", line 398, in properties_changed
    self.services_resolved()
  File "/data/home/root/victron-master/lib/victron_bluetooth/victron_gatt.py", line 85, in services_resolved
    self.start_send_init_squence()
  File "/data/home/root/victron-master/lib/victron_bluetooth/victron_gatt.py", line 153, in start_send_init_squence
    self.send_init_sequence()
  File "/data/home/root/victron-master/lib/victron_bluetooth/victron_gatt.py", line 159, in send_init_sequence
    c = self.characteristics[uuid]
KeyError: '306b0002-b081-4037-83dc-e59fcc3cdfd0'

I'm using the built-in Bluetooth connection in a Raspberry Pi 3B+. The SmartSolar is connected as shown in bluetoothctl:

Device C7:FB:23:EF:97:A3 (random)
        Name: SmartSolar HQ1950WPKXP
        Alias: SmartSolar HQ1950WPKXP
        Paired: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Vendor specific           (306b0001-b081-4037-83dc-e59fcc3cdfd0)
        UUID: Vendor specific           (68c10001-b17f-4d3a-a290-34ad6499937c)
        UUID: Vendor specific           (97580001-ddf1-48be-b73e-182664615d8e)
        ManufacturerData Key: 0x02e1
        ManufacturerData Value:
  01 aa 3d 3e a5 9a a4 26 82 0b 00 00 6d 84 ed 5b  ..=>...&....m..[
        AdvertisingFlags:
  00                                               .
        AdvertisingData Key: 0x00 (0)
        AdvertisingData Value:
  ff e1 02 02 aa 3d 3e 9a 7f 0d 82 0b 54 87 54 db  .....=>.....T.T.
  3e 77 67 03 d8 35 f0 6a 4f f6 c2 d9 e7           >wg..5.jO....

I've removed and rediscovered the SmartSolar and can't see anything wrong there:

[bluetooth]# remove C7:FB:23:EF:97:A3
[DEL] Descriptor (Handle 0xec70)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000a/char000b/desc000d
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[DEL] Characteristic (Handle 0xb288)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000a/char000b
        00002a05-0000-1000-8000-00805f9b34fb
        Service Changed
[DEL] Primary Service (Handle 0x0020)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000a
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
[DEL] Descriptor (Handle 0xf2bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e/char000f/desc0011
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[DEL] Characteristic (Handle 0xa098)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e/char000f
        68c10002-b17f-4d3a-a290-34ad6499937c
        Vendor specific
[DEL] Characteristic (Handle 0x50a0)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e/char0012
        68c10003-b17f-4d3a-a290-34ad6499937c
        Vendor specific
[DEL] Primary Service (Handle 0x0020)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e
        68c10001-b17f-4d3a-a290-34ad6499937c
        Vendor specific
[DEL] Characteristic (Handle 0x7b98)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char0015
        97580002-ddf1-48be-b73e-182664615d8e
        Vendor specific
[DEL] Descriptor (Handle 0xf2bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char0017/desc0019
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[DEL] Characteristic (Handle 0x7040)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char0017
        97580003-ddf1-48be-b73e-182664615d8e
        Vendor specific
[DEL] Characteristic (Handle 0x6878)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char001a
        97580004-ddf1-48be-b73e-182664615d8e
        Vendor specific
[DEL] Descriptor (Handle 0xf2bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char001c/desc001e
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[DEL] Characteristic (Handle 0x5d38)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char001c
        97580006-ddf1-48be-b73e-182664615d8e
        Vendor specific
[DEL] Primary Service (Handle 0x0020)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014
        97580001-ddf1-48be-b73e-182664615d8e
        Vendor specific
[DEL] Descriptor (Handle 0xf2bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0020/desc0022
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[DEL] Characteristic (Handle 0x49c0)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0020
        6b0002b0-8140-3700-83dc-e59fcc3cdfd0
        Vendor specific
[DEL] Descriptor (Handle 0xf2bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0023/desc0025
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[DEL] Characteristic (Handle 0x3588)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0023
        306b0003-b081-4037-83dc-e59fcc3cdfd0
        Vendor specific
[DEL] Descriptor (Handle 0xf2bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0026/desc0028
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[DEL] Characteristic (Handle 0x2588)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0026
        306b0004-b081-4037-83dc-e59fcc3cdfd0
        Vendor specific
[DEL] Primary Service (Handle 0x0020)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f
        306b0001-b081-4037-83dc-e59fcc3cdfd0
        Vendor specific
[DEL] Device C7:FB:23:EF:97:A3 SmartSolar HQ1950WPKXP
Device has been removed

And then re-added:

[CHG] Device C7:FB:23:EF:97:A3 Connected: yes
Connection successful
[NEW] Primary Service (Handle 0x88bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000a
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000a/char000b
        00002a05-0000-1000-8000-00805f9b34fb
        Service Changed
[NEW] Descriptor (Handle 0x6e54)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000a/char000b/desc000d
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service (Handle 0x88bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e
        68c10001-b17f-4d3a-a290-34ad6499937c
        Vendor specific
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e/char000f
        68c10002-b17f-4d3a-a290-34ad6499937c
        Vendor specific
[NEW] Descriptor (Handle 0x8474)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e/char000f/desc0011
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service000e/char0012
        68c10003-b17f-4d3a-a290-34ad6499937c
        Vendor specific
[NEW] Primary Service (Handle 0x88bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014
        97580001-ddf1-48be-b73e-182664615d8e
        Vendor specific
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char0015
        97580002-ddf1-48be-b73e-182664615d8e
        Vendor specific
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char0017
        97580003-ddf1-48be-b73e-182664615d8e
        Vendor specific
[NEW] Descriptor (Handle 0xa18c)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char0017/desc0019
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char001a
        97580004-ddf1-48be-b73e-182664615d8e
        Vendor specific
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char001c
        97580006-ddf1-48be-b73e-182664615d8e
        Vendor specific
[NEW] Descriptor (Handle 0xaf84)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service0014/char001c/desc001e
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service (Handle 0x88bc)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f
        306b0001-b081-4037-83dc-e59fcc3cdfd0
        Vendor specific
[NEW] Characteristic (Handle 0x77a0)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0020
        6b0002b0-8140-3700-83dc-e59fcc3cdfd0
        Vendor specific
[NEW] Descriptor (Handle 0xcf4c)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0020/desc0022
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0023
        306b0003-b081-4037-83dc-e59fcc3cdfd0
        Vendor specific
[NEW] Descriptor (Handle 0xdd04)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0023/desc0025
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Characteristic (Handle 0x8894)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0026
        306b0004-b081-4037-83dc-e59fcc3cdfd0
        Vendor specific
[NEW] Descriptor (Handle 0xece4)
        /org/bluez/hci0/dev_C7_FB_23_EF_97_A3/service001f/char0026/desc0028
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[CHG] Device C7:FB:23:EF:97:A3 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device C7:FB:23:EF:97:A3 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device C7:FB:23:EF:97:A3 UUIDs: 306b0001-b081-4037-83dc-e59fcc3cdfd0
[CHG] Device C7:FB:23:EF:97:A3 UUIDs: 68c10001-b17f-4d3a-a290-34ad6499937c
[CHG] Device C7:FB:23:EF:97:A3 UUIDs: 97580001-ddf1-48be-b73e-182664615d8e
[CHG] Device C7:FB:23:EF:97:A3 ServicesResolved: yes

And pairing:

[bluetooth]# scan on
[NEW] Device C7:FB:23:EF:97:A3 SmartSolar HQ1950WPKXP
[bluetooth]# pair  C7:FB:23:EF:97:A3
Attempting to pair with C7:FB:23:EF:97:A3
[CHG] Device C7:FB:23:EF:97:A3 Connected: yes
Request passkey
[agent] Enter passkey (number in 0-999999): xxxxxx
Pairing successful
[SmartSolar HQ1950WPKXP]#

Any thoughts or suggestions?

Edit: Forgot to mention, system has been rebooted several times.

exception after random runtime bluetooth

Setup:

  • Victron SmartSolar 100/15 with default bluetooth stack on raspbian current version.
  • victron.py pushing data into mqtt

After running fine for a while the following exception occurs. (see below)
I can immediately restart and victron.py continues to fetch data. I know that the bluetooth connection can be unreliable but maybe theres something to catch in the code here.

[INFO ] (2022-10-12 04:10:26,478) victron_bluetooth.py::224 Solar1: Connecting...
[INFO ] (2022-10-12 04:10:37,245) victron_gatt.py::50 Solar1: Connected!
[INFO ] (2022-10-12 04:10:37,247) victron_gatt.py::50 Solar1: Connected!
[INFO ] (2022-10-12 04:10:40,344) victron_gatt.py::50 Solar1: Connected!
[INFO ] (2022-10-12 04:10:58,485) victron_gatt.py::62 Solar1: Disconnected!
[INFO ] (2022-10-12 04:11:59,511) victron_bluetooth.py::224 Solar1: Connecting...
[INFO ] (2022-10-12 04:12:03,818) victron_gatt.py::50 Solar1: Connected!
[INFO ] (2022-10-12 04:12:03,819) victron_gatt.py::62 Solar1: Disconnected!
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/anschi/.local/lib/python3.9/site-packages/gatt/gatt_linux.py", line 138, in start_discovery
self._adapter.SetDiscoveryFilter(discovery_filter)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in call
return self._connection.call_blocking(self._named_service,
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.7 was not provided by any .service files

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 1266, in run
self.function(*self.args, **self.kwargs)
File "/home/anschi/apps/victron/victron.py", line 25, in victron_thread
v.connect_disconnect_loop()
File "/home/anschi/apps/victron/lib/victron.py", line 52, in connect_disconnect_loop
self.victron_type.connect_disconnect_loop(self.cmd, self.config['timer'])
File "/home/anschi/apps/victron/lib/victron_bluetooth/victron_bluetooth.py", line 248, in connect_disconnect_loop
if self.connect_loop():
File "/home/anschi/apps/victron/lib/victron_bluetooth/victron_bluetooth.py", line 220, in connect_loop
manager.start_discovery()
File "/home/anschi/.local/lib/python3.9/site-packages/gatt/gatt_linux.py", line 149, in start_discovery
raise _error_from_dbus_error(e)
gatt.errors.Failed: The name :1.7 was not provided by any .service files

SER# requested for smartshunt on serial interface

Hello,

I got following crash:

(venv) pi@rpi-jinx:~/victron $ python victron.py -d 0
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 1266, in run
    self.function(*self.args, **self.kwargs)
  File "/home/pi/victron/victron.py", line 25, in victron_thread
    v = Victron(config, vdevice_config, output, args, thread_count, thread_q)
  File "/home/pi/victron/lib/victron.py", line 40, in __init__
    pid, ser, fw = self.victron_type.get_device_info()
  File "/home/pi/victron/lib/victron_serial/victron_serial.py", line 26, in get_device_info
    return self.victron_device.get_device_info()
  File "/home/pi/victron/lib/victron_serial/victron_smartshunt.py", line 61, in get_device_info
    ser = self.MAP['SER#'][4](data['SER#'], self.MAP['SER#'])
KeyError: 'SER#
devices:
    - name: Shunt1
      type: smartshunt
      protocol: serial
      port: /dev/ttyUSB0

It seems like the smartshunt is not supporting this field on the serial interface.

Support for SmartSolar over BT LE

I tried the code from https://github.com/vvvrrooomm/victron
and it works ;) Can you add support for this? I couldnยดt get your code to work.
There are still errors but some Value are ok:
SmartSolar: SmartSolar Solar Voltage: 33.64V
SmartSolar: Voltage: 13.56V
SmartSolar: SmartSolar Battery Current: 0.2A
...
Seems there is no support for BT LE and Smartsolar yet..
Here is the output from other script:

python3 victron.py -d 2
starting with devices: 2
prepare device SmartSolar
SmartSolar start timer loop
manager event loop startinf
SmartSolar connect
SmartSolar: [F5:4D:3D:9C:1B:F6] Connected
SmartSolar connected:True
SmartSolar BT connected until 15:36:32
SmartSolar:subscribe notifications
SmartSolar:characteristics empty, sleep & retry - CHECK DEVICE PAIRING!
SmartSolar: [F5:4D:3D:9C:1B:F6] Resolved services
[F5:4D:3D:9C:1B:F6] Service [306b0001-b081-4037-83dc-e59fcc3cdfd0] (vendor, smartsolar & BMV712 )
[F5:4D:3D:9C:1B:F6] Characteristic [306b0004-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0003-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0002-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Service [97580001-ddf1-48be-b73e-182664615d8e] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [97580006-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580004-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580003-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580002-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Service [68c10001-b17f-4d3a-a290-34ad6499937c] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [68c10003-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Characteristic [68c10002-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Service [00001801-0000-1000-8000-00805f9b34fb] (generic attributes)
[F5:4D:3D:9C:1B:F6] Characteristic [00002a05-0000-1000-8000-00805f9b34fb]
SmartSolar: notifications for 000c: 00002a05-0000-1000-8000-00805f9b34fb
SmartSolar: notifications for 0010: 68c10002-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0013: 68c10003-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0016: 97580002-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0018: 97580003-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001b: 97580004-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001d: 97580006-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0021: 306b0002-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0024: 306b0003-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0027: 306b0004-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: enable notifications done
SmartSolar send init sequence
SmartSolar: sending 0021, databytearray(b'\xfa\x80\xff')
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9\x80')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x01')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x03\x00')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'\x03\x01\x03\x03")
SmartSolar: write succeeded
SmartSolar: sending 0027, databytearray(b'\x05\x00\x81\x19\xec\x0f\x05\x00\x81\x19\xec\x0e\x05\x00\x81\x19\x01\x0c\x05\x00')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x81\x18\x90\x05\x00\x81\x19\xec?\x05\x00\x81\x19\xec\x12')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x02\x9f\x00\x00\x01\x00\x03\x01\xff'
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x19\xec\xdc\x05\x03\x81\x19\xec\xeb\x05\x03\x81\x19\xec\xed')
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x07\x00\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'")
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: write succeeded
SmartSolar: unknown single packet: b'\x07\x00\x03\x00\x07\x00\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: error handling: b'\t\x00\x19\xec\x0f\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\t\x00\x19\xec\x0e\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\t\x00\x19\x01\x0c\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\t\x00\x18\x90\x01'
SmartSolar: error handling: b'\x08\x00\x19\xec?A\x00': 'unknown command 0x3f'
SmartSolar: error handling: b'\t\x00\x19\xec\x12\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\xf7\x03\x00'
SmartSolar: error handling: b'\t\x03\x19\xec\xeb\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: error handling: b'\t\x03\x19\xec\xed\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.64V
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.7V
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xe5\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbB+\r'
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.7V
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xe6\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbB+\r'
SmartSolar: Voltage: 13.56V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.73V
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xe7\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.76V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xe8\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbB6\r'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xe9\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.88V
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: error handling: b'\x08\x03\x19\x01\x0eA\x00': 18416392
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xea\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbB=\r'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.92V
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xeb\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 33.95V
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xec\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbBK\r'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 34.04V
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xed\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BL\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBL\x05'
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xee\x06\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\x10PX"\x00\x04\x00\x00\x00\x00\x00\x00\x00\x8c\x05\xa9\x04': 3961062152
SmartSolar: error handling: b'\x00\x00\x00\x00\x00*\x00\x01\x00\x12\x02\x14\x00\x00\x00\x0e\x00K\x102': 3961062152
SmartSolar: unknown single packet: b'\x00'
SmartSolar: [F5:4D:3D:9C:1B:F6] Disconnected
SmartSolar planned disconnect
SmartSolar BT disconnected, connecting again at 15:37:26
SmartSolar connecting in 30
SmartSolar connect
SmartSolar: [F5:4D:3D:9C:1B:F6] Connected
SmartSolar connected:True
SmartSolar BT connected until 15:38:26
SmartSolar:subscribe notifications
SmartSolar: notifications for 000c: 00002a05-0000-1000-8000-00805f9b34fb
SmartSolar: notifications for 0010: 68c10002-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0013: 68c10003-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0016: 97580002-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0018: 97580003-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001b: 97580004-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001d: 97580006-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0021: 306b0002-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0024: 306b0003-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0027: 306b0004-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: enable notifications done
SmartSolar: [F5:4D:3D:9C:1B:F6] Resolved services
[F5:4D:3D:9C:1B:F6] Service [306b0001-b081-4037-83dc-e59fcc3cdfd0] (vendor, smartsolar & BMV712 )
[F5:4D:3D:9C:1B:F6] Characteristic [306b0004-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0003-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0002-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Service [97580001-ddf1-48be-b73e-182664615d8e] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [97580006-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580004-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580003-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580002-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Service [68c10001-b17f-4d3a-a290-34ad6499937c] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [68c10003-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Characteristic [68c10002-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Service [00001801-0000-1000-8000-00805f9b34fb] (generic attributes)
[F5:4D:3D:9C:1B:F6] Characteristic [00002a05-0000-1000-8000-00805f9b34fb]
SmartSolar send init sequence
SmartSolar: sending 0021, databytearray(b'\xfa\x80\xff')
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9\x80')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x01')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x03\x00')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'\x03\x01\x03\x03")
SmartSolar: write succeeded
SmartSolar: sending 0027, databytearray(b'\x05\x00\x81\x19\xec\x0f\x05\x00\x81\x19\xec\x0e\x05\x00\x81\x19\x01\x0c\x05\x00')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x81\x18\x90\x05\x00\x81\x19\xec?\x05\x00\x81\x19\xec\x12')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x19\xec\xdc\x05\x03\x81\x19\xec\xeb\x05\x03\x81\x19\xec\xed')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x02\x9f\x00\x00\x01\x00\x03\x01\xff'
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'")
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x07\x00\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: unknown single packet: b'\x07\x00\x03\x00\x07\x00\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: error handling: b'\t\x00\x19\xec\x0f\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\t\x00\x19\xec\x0e\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\t\x00\x19\x01\x0c\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: write succeeded
SmartSolar: unknown single packet: b'\t\x00\x18\x90\x01'
SmartSolar: error handling: b'\x08\x00\x19\xec?A\x00': 'unknown command 0x3f'
SmartSolar: error handling: b'\t\x00\x19\xec\x12\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\xf7\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: error handling: b'\t\x03\x19\xec\xeb\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: error handling: b'\t\x03\x19\xec\xed\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 35.63V
SmartSolar: error handling: b'\x08\x03\x19\xecZDU\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 35.66V
SmartSolar: error handling: b'\x08\x03\x19\xecZDV\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBL\x05'
SmartSolar: error handling: b'\x08\x03\x19\xecZDW\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 35.67V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 35.66V
SmartSolar: error handling: b'\x08\x03\x19\xecZDX\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBM\x05'
SmartSolar: error handling: b'\x08\x03\x19\xecZDY\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: SmartSolar Solar Voltage: 35.67V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbB\xee\r'
SmartSolar: error handling: b'\x08\x03\x19\xecZDZ\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBM\x05'
SmartSolar: error handling: b'\x08\x03\x19\xecZD[\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 35.68V
SmartSolar: error handling: b'\x08\x03\x19\xecZD\\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 35.69V
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BL\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\x01\x0eA\x00': 18416392
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBM\x05'
SmartSolar: error handling: b'\x08\x03\x19\xecZD]\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBK\x05'
SmartSolar: error handling: b'\x08\x03\x19\xecZD^\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: [F5:4D:3D:9C:1B:F6] Disconnected
SmartSolar planned disconnect
SmartSolar BT disconnected, connecting again at 15:39:18
SmartSolar connecting in 30
SmartSolar connect
SmartSolar: [F5:4D:3D:9C:1B:F6] Connected
SmartSolar connected:True
SmartSolar BT connected until 15:40:19
SmartSolar:subscribe notifications
SmartSolar: notifications for 000c: 00002a05-0000-1000-8000-00805f9b34fb
SmartSolar: notifications for 0010: 68c10002-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0013: 68c10003-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0016: 97580002-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0018: 97580003-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001b: 97580004-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001d: 97580006-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0021: 306b0002-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0024: 306b0003-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0027: 306b0004-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: enable notifications done
SmartSolar: [F5:4D:3D:9C:1B:F6] Resolved services
[F5:4D:3D:9C:1B:F6] Service [306b0001-b081-4037-83dc-e59fcc3cdfd0] (vendor, smartsolar & BMV712 )
[F5:4D:3D:9C:1B:F6] Characteristic [306b0004-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0003-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0002-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Service [97580001-ddf1-48be-b73e-182664615d8e] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [97580006-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580004-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580003-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580002-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Service [68c10001-b17f-4d3a-a290-34ad6499937c] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [68c10003-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Characteristic [68c10002-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Service [00001801-0000-1000-8000-00805f9b34fb] (generic attributes)
[F5:4D:3D:9C:1B:F6] Characteristic [00002a05-0000-1000-8000-00805f9b34fb]
SmartSolar send init sequence
SmartSolar: sending 0021, databytearray(b'\xfa\x80\xff')
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9\x80')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x01')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x03\x00')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'\x03\x01\x03\x03")
SmartSolar: write succeeded
SmartSolar: sending 0027, databytearray(b'\x05\x00\x81\x19\xec\x0f\x05\x00\x81\x19\xec\x0e\x05\x00\x81\x19\x01\x0c\x05\x00')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x81\x18\x90\x05\x00\x81\x19\xec?\x05\x00\x81\x19\xec\x12')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x19\xec\xdc\x05\x03\x81\x19\xec\xeb\x05\x03\x81\x19\xec\xed')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x02\x9f\x00\x00\x01\x00\x03\x01\xff'
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'")
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x07\x00\x03\x00'
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: write succeeded
SmartSolar: unknown single packet: b'\x07\x00\x03\x00\x07\x00\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: error handling: b'\t\x00\x19\xec\x0f\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\t\x00\x19\xec\x0e\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\t\x00\x19\x01\x0c\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\t\x00\x18\x90\x01'
SmartSolar: error handling: b'\x08\x00\x19\xec?A\x00': 'unknown command 0x3f'
SmartSolar: error handling: b'\t\x00\x19\xec\x12\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\xf7\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: error handling: b'\t\x03\x19\xec\xeb\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: error handling: b'\t\x03\x19\xec\xed\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.28V
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BL\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.27V
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xc6\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.56V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.3V
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBK\x05'
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xc7\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xc8\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xc9\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: unknown single packet: b'\x08\x03\x18\x90A\x01'
SmartSolar: error handling: b'\x08\x03\x19\x01PD!\x00\x00\x00': 18416392
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xca\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xcb\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xcc\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.31V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbB1\x0e'
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xcd\x07\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\x01\x0eA\x00': 18416392
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbB.\x0e'
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xce\x07\x12\x00': 3961062152
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBK\x05'
SmartSolar: error handling: b'\x08\x03\x19\xecZD\xcf\x07\x12\x00': 3961062152
SmartSolar: [F5:4D:3D:9C:1B:F6] Disconnected
SmartSolar planned disconnect
SmartSolar BT disconnected, connecting again at 15:41:11
SmartSolar connecting in 30
SmartSolar connect
SmartSolar: [F5:4D:3D:9C:1B:F6] Connected
SmartSolar connected:True
SmartSolar BT connected until 15:42:11
SmartSolar:subscribe notifications
SmartSolar: notifications for 000c: 00002a05-0000-1000-8000-00805f9b34fb
SmartSolar: notifications for 0010: 68c10002-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0013: 68c10003-b17f-4d3a-a290-34ad6499937c
SmartSolar: notifications for 0016: 97580002-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0018: 97580003-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001b: 97580004-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 001d: 97580006-ddf1-48be-b73e-182664615d8e
SmartSolar: notifications for 0021: 306b0002-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0024: 306b0003-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: notifications for 0027: 306b0004-b081-4037-83dc-e59fcc3cdfd0
SmartSolar: enable notifications done
SmartSolar: [F5:4D:3D:9C:1B:F6] Resolved services
[F5:4D:3D:9C:1B:F6] Service [306b0001-b081-4037-83dc-e59fcc3cdfd0] (vendor, smartsolar & BMV712 )
[F5:4D:3D:9C:1B:F6] Characteristic [306b0004-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0003-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Characteristic [306b0002-b081-4037-83dc-e59fcc3cdfd0]
[F5:4D:3D:9C:1B:F6] Service [97580001-ddf1-48be-b73e-182664615d8e] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [97580006-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580004-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580003-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Characteristic [97580002-ddf1-48be-b73e-182664615d8e]
[F5:4D:3D:9C:1B:F6] Service [68c10001-b17f-4d3a-a290-34ad6499937c] (vendor, VE.Direct Smart)
[F5:4D:3D:9C:1B:F6] Characteristic [68c10003-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Characteristic [68c10002-b17f-4d3a-a290-34ad6499937c]
[F5:4D:3D:9C:1B:F6] Service [00001801-0000-1000-8000-00805f9b34fb] (generic attributes)
[F5:4D:3D:9C:1B:F6] Characteristic [00002a05-0000-1000-8000-00805f9b34fb]
SmartSolar send init sequence
SmartSolar: sending 0021, databytearray(b'\xfa\x80\xff')
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9\x80')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x01')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x03\x00')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'\x03\x01\x03\x03")
SmartSolar: write succeeded
SmartSolar: sending 0027, databytearray(b'\x05\x00\x81\x19\xec\x0f\x05\x00\x81\x19\xec\x0e\x05\x00\x81\x19\x01\x0c\x05\x00')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x02\x9f\x00\x00\x01\x00\x03\x01\xff'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\x07\x00\x03\x00'
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x81\x18\x90\x05\x00\x81\x19\xec?\x05\x00\x81\x19\xec\x12')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: unknown single packet: b'\x07\x00\x03\x00\x07\x00\x03\x00'
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b'\x19\xec\xdc\x05\x03\x81\x19\xec\xeb\x05\x03\x81\x19\xec\xed')
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: write succeeded
SmartSolar: sending 0024, databytearray(b"\x06\x00\x82\x18\x93B\x10'")
SmartSolar: write succeeded
SmartSolar: sending 0021, databytearray(b'\xf9A')
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: error handling: b'\t\x00\x19\xec\x0f\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: write succeeded
SmartSolar: error handling: b'\t\x00\x19\xec\x0e\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\t\x00\x19\x01\x0c\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\t\x00\x18\x90\x01'
SmartSolar: error handling: b'\x08\x00\x19\xec?A\x00': 'unknown command 0x3f'
SmartSolar: error handling: b'\t\x00\x19\xec\x12\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: unknown single packet: b'\xf7\x03\x00'
SmartSolar: unknown single packet: b'\xf9\x01'
SmartSolar: error handling: b'\t\x03\x19\xec\xeb\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: unknown single packet: b"\x08\x00\x18\x93B\x10'"
SmartSolar: error handling: b'\t\x03\x19\xec\xed\x01': decode_fixed_len() takes 1 positional argument but 2 were given
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BL\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xecZD6\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBM\x05'
SmartSolar: Voltage: 13.56V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xecZD7\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBK\x05'
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.82V
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: error handling: b'\x08\x03\x19\xecZD8\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbBc\x0e'
SmartSolar: Voltage: 13.55V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.82V
SmartSolar: error handling: b'\x08\x03\x19\xecZD9\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.83V
SmartSolar: Voltage: 13.56V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x82\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.84V
SmartSolar: error handling: b'\x08\x03\x19\xecZD:\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.85V
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.86V
SmartSolar: error handling: b'\x08\x03\x19\xecZD;\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.85V
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xecZD<\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00': 3961062152
SmartSolar: Voltage: 13.56V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x85\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.86V
SmartSolar: error handling: b'\x08\x03\x19\x02\x00A\x01': 35193608
SmartSolar: error handling: b'\x08\x03\x19\x02\x02D\x02\x00\x00\x00': 35193608
SmartSolar: SmartSolar Battery Current: 0.2A
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BL\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\xecZD=\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\x8dBM\x05'
SmartSolar: Voltage: 13.56V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.87V
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BM\x05': 'unknown command 0xa9'
SmartSolar: error handling: b'\x08\x03\x19\x01\x0eA\x00': 18416392
SmartSolar: error handling: b'\x08\x03\x19\xecZD>\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.89V
SmartSolar: Voltage: 13.56V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.88V
SmartSolar: error handling: b'\x08\x03\x19\xecZD?\x08\x12\x00': 3961062152
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x90\x01\x00\x00\x08\x03': 3961062152
SmartSolar: unknown single packet: b'\x19\xed\xbbBf\x0e'
SmartSolar: Voltage: 13.57V
SmartSolar: error handling: b'\x08\x03\x19\xec\x8aB\x04\x00\x08\x03\x19\xed\xbcD\x83\x01\x00\x00': 3961062152
SmartSolar: SmartSolar Solar Voltage: 36.89V
SmartSolar: error handling: b'\x08\x03\x19\xed\xa9BL\x05': 'unknown command 0xa9'
SmartSolar: [F5:4D:3D:9C:1B:F6] Disconnected

Smartshunt Unsynchronized SoC

When the SoC is not synchronized, it throws an Exception:

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.9/threading.py", line 1299, in run
    self.function(*self.args, **self.kwargs)
  File "/src/victron.py", line 26, in victron_thread
    v.connect_disconnect_loop()
  File "/src/lib/victron.py", line 52, in connect_disconnect_loop
    self.victron_type.connect_disconnect_loop(self.cmd, self.config['timer'])
  File "/src/lib/victron_serial/victron_serial.py", line 36, in connect_disconnect_loop
    self.victron_device.get_data(self.output)
  File "/src/lib/victron_serial/victron_smartshunt.py", line 73, in get_data
    data = command[4](value, command)
  File "/src/lib/helper.py", line 44, in convert_int_factor
    data = int(value) * command[3]
ValueError: invalid literal for int() with base 10: '---'

missing values "virtual load output" "state [bulk, float, absorption]"

Hey,

very fine project, meeting quite exactly my use case: getting my SmartSolar values via bluetooth and mqtt into the home assistant of my camper.
Sadly, I'm missing these values: "virtual load output" and "state [bulk, float, absorption]". I'm not sure, why:

  • Just not reverse engineered? How can I help? Maybe some basic hints how to filter the debug log or something, then I'm really pleased to contribute.
  • Just not implemented, not sent via MQTT?

Since the official GATT-protocol ist officially not available for other devices than SmartShunt (or did I miss something?), I think, I'm connecting via reverse engineered VictronConnect-protocol? I use this in config.yml:

devices:
    - name: SmartSolar
      type: smartsolar
      protocol: bluetooth
      mac: ...

The advertisement protocol is no solution, since it doesn't contain the (for me important) virtual load output state - neither the App show this value in the preview values section, nor the spec includes it. Further more, the advertisment doesn't include the panel voltage and current, which I get here.

Thank You very much for hints how to get these values and how to contribute.

Bluetooth Ping

Hey there,

Any plan to implement the ping to prevent the regular bluetooth disconnects? I see there are some provisions there for that already and only send_ping needs to be called regularly from the right place.

Set Config

Hey there,

I'd be interested in the ability to set the Current Limit over bluetooth, based on other system variables, in realtime.
Is that possible at all with the current approach to this, has it even been tried? Or is everybody mostly interested in reading values?

Install error

To be able to install everything from requirements.txt, I had to
apt-get install libcairo2 libcairo2-dev libgirepository1.0-dev python3-dbus
on a RPi 3B+.
Maybe this could be integrated into readme.md?

Also some packages made problems, which I could solve by changing

  • typed-ast==1.4.3 to typed-ast>=1.4.3
  • PyGObject==3.38.0 to PyGObject>=3.38.0
  • dbus-python==1.2.16 to pydbus (I read it here)

in requirements.txt. I don't know, if this is a good fix, but it made the project work for me.

Quite many dependencies for this project. Are they really all neccesary?

Unreliable serial Connection

Hi,

my read out is very unreliable
Its an Smartsolar 75/15 connected via the original ve.direct USB Cable to an Raspberry pi Zero (1 and 2)

It throws Errors like:

[WARNING] (2022-07-01 11:28:46) victron_smartsolar.py::58 smartsolar2: H2c
PID not found in mapping dictionary
[WARNING] (2022-07-01 11:28:51) victron_smartsolar.py::58 smartsolar2: LOAD not found in mapping dictionary
[WARNING] (2022-07-01 11:28:51) victron_smartsolar.py::58 smartsolar2: Mr
PID not found in mapping dictionary
[WARNING] (2022-07-01 11:28:51) victron_smartsolar.py::58 smartsolar2: H2T
PID not found in mapping dictionary
[WARNING] (2022-07-01 11:28:51) victron_smartsolar.py::58 smartsolar2: H2c
PID not found in mapping dictionary

Looks like Serial protocol parsing issues.
Does anyone experience similar issues?

Also ive noticed that the vedirect Lib is unmaintained.
There are at least 2 Forks:

https://github.com/karioja/vedirect (original)
https://github.com/nznobody/vedirect (micropython only?)
https://github.com/jmfife/vedirect (incompatible?)
any plans to support one of these?

Thx

No values published to log or MQTT from Victron Smartshunt

I'm able to connect on both bluetooth and bluetooth-ble to a victron smartshunt but I can't seem to get any data out of it. The only MQTT topics published are the HASS config topics. I've tried with hass set to True and False and it's the same.

Here is my BLE config

devices:
    - name: Shunt1
      type: smartshunt
      protocol: bluetooth-ble
      mac: D1:43:04:AA:84:9A

My MQTT config:

mqtt:
    host: 192.168.0.51
    port: 1883
    base_topic: victron
    hass: True

and an example of some of the logs:

[DEBUG  ] (2021-12-30 00:39:33,047) victron_ble.py::80 Shunt1: Will reconnect at 2021-12-30 00:40:33.046711
[INFO   ] (2021-12-30 00:40:34,165) victron_ble.py::47 Shunt1: Connecting...
[INFO   ] (2021-12-30 00:40:35,217) victron_gatt_ble.py::41 Shunt1: Connect successful!
[DEBUG  ] (2021-12-30 00:40:37,031) victron_gatt_ble.py::68 Shunt1: [D1:43:04:AA:84:9A] Resolved services
[DEBUG  ] (2021-12-30 00:40:37,035) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6628>
[DEBUG  ] (2021-12-30 00:40:37,293) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6760>
[DEBUG  ] (2021-12-30 00:40:37,308) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6130>
[DEBUG  ] (2021-12-30 00:40:37,323) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6d30>
[DEBUG  ] (2021-12-30 00:40:37,339) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6250>
[DEBUG  ] (2021-12-30 00:40:37,354) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6460>
[DEBUG  ] (2021-12-30 00:40:37,369) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6100>
[DEBUG  ] (2021-12-30 00:40:37,384) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6688>
[DEBUG  ] (2021-12-30 00:40:37,399) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6160>
[DEBUG  ] (2021-12-30 00:40:37,417) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c6070>
[DEBUG  ] (2021-12-30 00:40:37,432) victron_gatt_ble.py::72 Shunt1: Read value from characteristic <gatt.gatt_linux.Characteristic object at 0xb39c60d0>
[INFO   ] (2021-12-30 00:40:37,592) victron_gatt_ble.py::53 Shunt1: Disconnect successful!
[DEBUG  ] (2021-12-30 00:40:37,605) victron_ble.py::80 Shunt1: Will reconnect at 2021-12-30 00:41:37.605105

I'm running on a Pi Zero W

Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

SmartShunt 500A/50mV
Firmware: 4.08
Bluetooth enabled = true
Bluetooth GATT service enabled = true

I've swapped from my desired base topic to the example one in config.yml. The Pi is sitting less than a foot away from the Shunt (I could connect when it was further away plugged into mains, but it would never read the characteristics so I moved it to my inverter).

I'm going to keep playing with it more tomorrow and add some extra debug lines for troubleshooting.

Any help is much appreciated!

Installing requirements fails

Are there any specific instructions for installing the requirements on VenusOS v2.85? I'm getting an error saying that pycairo can't be built:

$ pip3.8 install pycairo
Collecting pycairo
  Using cached pycairo-1.21.0.tar.gz (340 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pycairo
  Building wheel for pycairo (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp487fvecp
       cwd: /var/volatile/tmp/pip-install-b_7f_1st/pycairo
  Complete output (15 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-cpython-38
  creating build/lib.linux-armv7l-cpython-38/cairo
  copying cairo/__init__.py -> build/lib.linux-armv7l-cpython-38/cairo
  copying cairo/__init__.pyi -> build/lib.linux-armv7l-cpython-38/cairo
  copying cairo/py.typed -> build/lib.linux-armv7l-cpython-38/cairo
  running build_ext
  Package cairo was not found in the pkg-config search path.
  Perhaps you should add the directory containing 'cairo.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'cairo' found
  Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.

  ERROR: Failed building wheel for pycairo
Failed to build pycairo
ERROR: Could not build wheels for pycairo which use PEP 517 and cannot be installed directly

I tried installing PEP 517 manually but it's not changed the error.

Error after few minutes

After a few minutes(5-10) i get the follwoing error:
`[INFO ] (2023-04-09 11:15:16,504) victron_gatt.py::62 MPPT-Solar: Disconnected!
[DEBUG ] (2023-04-09 11:15:16,507) victron_bluetooth.py::252 MPPT-Solar: Will reconnect at 2023-04-09 11:16:16.507228
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/heavyreisen/.local/lib/python3.9/site-packages/gatt/gatt_linux.py", line 139, in start_discovery
self._adapter.StartDiscovery()
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in call
return self._connection.call_blocking(self._named_service,
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 1266, in run
self.function(*self.args, **self.kwargs)
File "/home/heavyreisen/Downloads/victron/victron.py", line 25, in victron_thread
v.connect_disconnect_loop()
File "/home/heavyreisen/Downloads/victron/lib/victron.py", line 52, in connect_disconnect_loop
self.victron_type.connect_disconnect_loop(self.cmd, self.config['timer'])
File "/home/heavyreisen/Downloads/victron/lib/victron_bluetooth/victron_bluetooth.py", line 248, in connect_disconnect_loop
if self.connect_loop():
File "/home/heavyreisen/Downloads/victron/lib/victron_bluetooth/victron_bluetooth.py", line 220, in connect_loop
manager.start_discovery()
File "/home/heavyreisen/.local/lib/python3.9/site-packages/gatt/gatt_linux.py", line 149, in start_discovery
raise _error_from_dbus_error(e)
gatt.errors.Failed: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
`

Config:
`## Add your devices here:
devices:

- name: Shunt1

type: smartshunt

protocol: bluetooth-ble

mac: fd:d4:50:0f:6c:1b

- name: MPPT-Solar
  type: smartsolar
  protocol: bluetooth
  mac: C7:F9:7F:61:6E:37

- name: Phoenix1

type: pheonix

protocol: serial

port: /dev/ttyUSB0

#devices:

- name: Shunt1

type: smartshunt

protocol: bluetooth-ble

mac: fd:d4:50:0f:6c:1b

timer (in seconds) IN DEVELOPMENT!

timer:
retry: 15
bluetooth:
connected: 60,
disconnected: 60
bluetooth-ble:
repeat: 60
serial:
repeat: 30

Logging:

possible values:

- syslog

- mqtt

- print

- json

logger: mqtt

If logging is set to mqtt, this section must be filled

Set hass to True if you want support for Homeassistant Discovery

Mandatory:
host: 192.168.178.22
port: 1883
base_topic: victron
hass: True
Optional:
username: admin
password: 580500
mqtt:
host: 192.168.178.22
port: 1883
base_topic: victron
hass: True
username: xxx
password: xxx

Collected enitites by device type:

If you change this, the names must be the same like in the value tables from victron.py

If you use collections it will send whole collection as json instead of individual values.

Replace key to name of your device: For example:

collections:

Shunt1:

battery:

- State Of Charge

- ...

WARNING: Please do not use collections for protocol bluetooth currently. It will probably not return any values!

POSSIBLE COLLECTION SERIAL:

smartshunt:

device:

- Product ID

- Firmware Version

battery:

- State Of Charge

- Time To Go

latest:

- Voltage

- Current

- Power

- Starter Battery Voltage

- Used Energy

history:

- Deepest Discharge

- Last Discharge

- Average Discharge

- Cumulative Ah Drawn

- Time Since Last Full

- Charge Cycles

- Full Discharges

- Battery Voltage min

- Battery Voltage max

- Synchonisations

- Alarm Voltage low

- Alarm Voltage high

- Starter Battery Voltage min

- Starter Battery Voltage max

- Total Discharged Energy

- Total Charged Energy

phoenix:

device:

- Product ID

- Serial

- Firmware

- Production Date

latest:

- Voltage

- AC Voltage

- AC Current

- Mode

- Status

- Warning

- Alarm Reason

smartsolar:

device:

- Day sequence Number (0..364)

- Product ID

- Serial

- Firmware

- Production Date

latest:

- Voltage

- Current

- Voltage Panel

- Power

- Status

- MPPT Tracker Operation Mode

- Off Reason

- Virtual Load Output

- Error Code

history:

- Energy All Time

- Energy Today

- Energy Today Max

- Energy Yesterday

- Energy Yesterday Max

POSSIBLE COLLECTION BLUETOOTH-BLE:

smartshunt:

battery:

- State Of Charge

- Remaining Time

latest:

- Voltage

- Starter Voltage

- Current

- Power

- Used Energy

collections:`

Missing option to fetch values permanently

As I have not seen a feature request option here I am opening this issue.
Using the SmartShunt vie Bluetooth works fine. Using the non-BLE option fetches data continuously for a few seconds and then disconnects (as designed).
I would like to see a permanent connection to be able to let it run like a daemon.
Thanks for your great work!

New gatt attributes

The smartshunt sends out new data via gatt ble protocol. I already added remaining time and starter voltage.

I need some help to decode the other values. I found these values on my smartshunt:
victron_smartshunt_ble.py::91 Shunt1: Characteristic (65970383-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Rawvalue: b'\xff\x7f'
victron_smartshunt_ble.py::92 Shunt1: Characteristic (65970383-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Value signed: 32767.0 | Value unsigned: 32767.0
victron_smartshunt_ble.py::91 Shunt1: Characteristic (65970382-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Rawvalue: b'\xff\xff'
victron_smartshunt_ble.py::92 Shunt1: Characteristic (65970382-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Value signed: -1.0 | Value unsigned: 65535.0
victron_smartshunt_ble.py::91 Shunt1: Characteristic (6597edec-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Rawvalue: b'\xff\xff'
victron_smartshunt_ble.py::92 Shunt1: Characteristic (6597edec-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Value signed: -1.0 | Value unsigned: 65535.0
victron_smartshunt_ble.py::91 Shunt1: Characteristic (6597ffff-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Rawvalue: b''
victron_smartshunt_ble.py::92 Shunt1: Characteristic (6597ffff-4bda-4c1e-af4b-551c4cf74769) not found in known Table | Value signed: 0.0 | Value unsigned: 0.0

Can somebody check, what values do you get? To get this output, just start a bluetooth-ble protocol smartshunt with debug option.
Thanks

Homeassistant is getting spammed with warnings

2022-01-24 23:34:16 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:16 WARNING (MainThread) [homeassistant.components.mqtt.mixins] Erroneous JSON: OFF
2022-01-24 23:34:16 WARNING (MainThread) [homeassistant.components.mqtt.mixins] Erroneous JSON: 0: None
2022-01-24 23:34:16 WARNING (MainThread) [homeassistant.components.mqtt.mixins] Erroneous JSON: SmartShunt 500A/50mV
2022-01-24 23:34:16 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] Erroneous JSON: 0xA389: SmartShunt 500A/50mV
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary
2022-01-24 23:34:17 WARNING (MainThread) [homeassistant.components.mqtt.mixins] JSON result was not a dictionary

I dont know what else could help with debugging the issue.

Implementation not working with smart solar / serial

Hi

I recently switched from the bluetooth to serial implementation which works fine for the smarthsunt, but not for the smartsolar products. After triggering the script manual I can see that there are missing dependencies to the library but this should be working (as it works with the smartshunt). Is there any advice that you can give me?

root@raspibus:/opt/victron# python3 victron.py -d 1
/opt/victron/victron.py:237: DeprecationWarning: Callback API version 1 is deprecated, update to latest version
  client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)
Exception in thread Thread-1 (read_data_callback):
Traceback (most recent call last):
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
  File "/opt/victron/victron.py", line 267, in <module>
    victron_thread(1, config, devices_config, q)
  File "/opt/victron/victron.py", line 24, in victron_thread
    self.run()
  File "/usr/lib/python3.11/threading.py", line 975, in run
    v = Victron(config, vdevice_config, output, args, thread_count, thread_q)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/victron/lib/victron.py", line 40, in __init__
    pid, ser, fw = self.victron_type.get_device_info()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    self._target(*self._args, **self._kwargs)
  File "/opt/victron/lib/victron_serial/victron_serial.py", line 59, in get_device_info
  File "/opt/victron/lib/victron_serial/victron_serial.py", line 18, in read_data_callback
    pid = self.map['PID'][4](data['PID'], self.map['PID'])
    callbackFunction(packet)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/victron/lib/victron_serial/victron_serial.py", line 40, in <lambda>
  File "/opt/victron/lib/helper.py", line 61, in convert_map_out
    callback_wrapper = lambda packet: self.read_data_callback(packet)
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return f'{value}: {command[3][value]}'
  File "/opt/victron/lib/victron_serial/victron_serial.py", line 103, in read_data_callback
                       ~~~~~~~~~~^^^^^^^
KeyError: '0xA07D'
    self.process_packet(packet)
  File "/opt/victron/lib/victron_serial/victron_serial.py", line 111, in process_packet
    self.send_out(key, value)
  File "/opt/victron/lib/victron_serial/victron_serial.py", line 119, in send_out
    data = helper_function(value, map_entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/victron/lib/helper.py", line 61, in convert_map_out
    return f'{value}: {command[3][value]}'
                       ~~~~~~~~~~^^^^^^^
KeyError: '0xA07D'

Cannot execute script

Hi Jonas,

I installed your script on my Raspberry Pi 3 B+ and connected the Victron SmartSolar 100 30 via original USB-Cable to the Pi.

I can check the Version of the script and so on, but I cannot execute the script properly. When I try, I get this:
pi@rpi:~/victron$ ./victron.py -d SmartsolarAlfred
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 1266, in run
self.function(*self.args, **self.kwargs)
File "/home/pi/victron/./victron.py", line 24, in victron_thread
v = Victron(config, vdevice_config, output, args, thread_count, thread_q)
File "/home/pi/victron/lib/victron.py", line 28, in init
self.victron_type = VictronSerial(device_config, self.output)
File "/home/pi/victron/lib/victron_serial/victron_serial.py", line 20, in init
from lib.victron_serial.victron_smartsolar import Smartsolar
File "/home/pi/victron/lib/victron_serial/victron_smartsolar.py", line 4, in
from vedirect import Vedirect
ImportError: cannot import name 'Vedirect' from 'vedirect' (unknown location)

Do you have any idea what causes this problem?

Regards
Sebastian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.