Fabian-Schmidt / esphome-victron_ble

Use official Victron BLE endpoint for fetching data from Victron devices via Bluetooth LE via ESPHome.
GNU General Public License v3.0
152 stars 15 forks source link

Smart BatteryProtect : DEVICE_STATE : Unkown device state (249) #18

Open Chris2834 opened 1 year ago

Chris2834 commented 1 year ago

Nicely integrated SmartSolar MPPT 75/15 and Smart BatteryProtect 12V/24V 65A. Thanks for your code!

So far all running fine, except the unknown device state msg.

text_sensor:

the log file states : ... [W][victron_ble.text_sensor:267]: [F3:61:37:41:62:C0] Unkown device state (249). [D][text_sensor:064]: 'BPS Device State': Sending state '249' ....

ESPHome version 2023.6.3

Victron Smart BatteryProtect 12V/24V 65A

Fabian-Schmidt commented 1 year ago

Hi Thanks for the feedback. What does the Victron App state as the current Device State for 249 (0xF9)? It should be displayed on the Device list (start page of the app).

Chris2834 commented 1 year ago

Hi Fabian,

when switching off / on / off by the Victron iPhone APP the „DEVICE_STATE_OFF“ is inverted state of output and „DEVICE_STATE“ switches from "OFF" to "249" and back to "OFF"

Is 249 (0xF9) code for state on with additional encoding for manual switch on by (iPhone) APP?

I will let it run with "automatic" settings only and report later again.

Fabian-Schmidt commented 1 year ago

Sounds like 249 should be Device State 'On'?

Chris2834 commented 1 year ago

nope, 249 is not directly related to the output state.

More Info on BPS behavior :

Setup the BPS with the Victron (iPhone) APP to switch internally auto on / off by batt level (here 23.6 off / 25.6 on). Activated the output with the APP as described earlier. Later today the BPS followed the rule and send an „WARNING_REASON“ == „Low_Voltage“ for 30 seconds as estimated, then switched of correctly the output power.

„ALARM“ from „OFF" to „ON" „ALARM_REASON“ from NA to „Low Voltage“ OFF_REASON from NA to „Protection Active“

DEVICE_STATE remains "249" !

DEVICE_STATE_FAULT remains „OFF“

DEVICE_STATE_OFF remains „OFF"

None of the (actual) HA sensors directly represents the physical on/off state of the hardware - see output voltage graph of HA.

Victron APP Screen indicating "STATE : On“ "OUTPUT : Off" with „Alarm E3 : Under voltage“

Fabian-Schmidt commented 1 year ago

The fields DEVICE_STATE_FAULT and DEVICE_STATE_OFF are just checks if the DEVICE_STATE has a certain value.

I cannot see the graph you are mentioning.

Is the state 249 potentially related to the separate load ouput state? What does the Victron App state on the Device List page? All information displayed on the Device list page are fetched via the same method as this library uses.

jsmath commented 5 months ago

Just wondering if it is possible to turn on/off the Smart BatteryProtect (to disconnect the battery) via home assistant (esphome API) or if this is only possible via the Victron app. My apologies for posting questions here.