batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Unable to find service template for discharge_start_service

Open JohanAlvedal opened this issue 1 year ago • 4 comments

Describe the bug

1248 | 2024-09-02 15:51:38.979404: Info: record_status Discharging target 7%-6%
1247 | 2024-09-02 15:51:38.969206: Completed run status Discharging
1246 | 2024-09-02 15:51:38.876680: Inverter 0 Wrote 6 to charge_limit, successfully now 6
1245 | 2024-09-02 15:51:34.844783: Inverter 0 Current charge limit is 5% and new target is 6%
1244 | 2024-09-02 15:51:34.844715: Warn: Inverter 0 unable to find service template for discharge_start_service
1243 | 2024-09-02 15:51:34.844549: Warn: Failed to decode response from http://supervisor/core/api/services/huawei_solar/forcible_discharge_soc
1242 | 2024-09-02 15:51:34.836734: Inverter 0 Call service huawei_solar/forcible_discharge_soc with data {'device_id': '6893ee838a0972bd3e50d9e0faa0ba5a', 'target_soc': 6, 'power': 3500}

Expected behavior Call action (service) charge an dischage missing template?

Predbat version

8.4.4

Environment details

  • Huawei Luna2000 10 kw battery
  • Standard HAOS installer

Log file

1248 | 2024-09-02 15:51:38.979404: Info: record_status Discharging target 7%-6%
1247 | 2024-09-02 15:51:38.969206: Completed run status Discharging
1246 | 2024-09-02 15:51:38.876680: Inverter 0 Wrote 6 to charge_limit, successfully now 6
1245 | 2024-09-02 15:51:34.844783: Inverter 0 Current charge limit is 5% and new target is 6%
1244 | 2024-09-02 15:51:34.844715: Warn: Inverter 0 unable to find service template for discharge_start_service
1243 | 2024-09-02 15:51:34.844549: Warn: Failed to decode response from http://supervisor/core/api/services/huawei_solar/forcible_discharge_soc
1242 | 2024-09-02 15:51:34.836734: Inverter 0 Call service huawei_solar/forcible_discharge_soc with data {'device_id': '6893ee838a0972bd3e50d9e0faa0ba5a', 'target_soc': 6, 'power': 3500}

JohanAlvedal avatar Sep 02 '24 13:09 JohanAlvedal

1244 | 2024-09-02 15:51:34.844715: Warn: Inverter 0 unable to find service template for discharge_start_service

This is a spurious warning and can be ignored (typo)

1243 | 2024-09-02 15:51:34.844549: Warn: Failed to decode response from http://supervisor/core/api/services/huawei_solar/forcible_discharge_soc 1242 | 2024-09-02 15:51:34.836734: Inverter 0 Call service huawei_solar/forcible_discharge_soc with data {'device_id': '6893ee838a0972bd3e50d9e0faa0ba5a', 'target_soc': 6, 'power': 3500}

This implies home assistant didnt like your sevice call. Is the service name and device_id correct, can you call this service in HA in developer tools and does it work?

springfall2008 avatar Sep 02 '24 21:09 springfall2008

ok could it be that earlier I ran charge_start_service: huawei_solar/forcible_charge_soc and so you and I had a discussion about running on time instead of %? You said I could change the time in the config file but I was unsure how The new formatting for in time is

charge_start_service: huawei_solar/forcible_charge charge_stop_service: huawei_solar/stop_forcible_charge discharge_start_service: huawei_solar/forcible_discharge discharge_stop_service: huawei_solar/stop_forcible_charge

To run in time instead of %, duration:XX must be added, but I'm not sure how it should look in the apps.yaml file

Action call in Home assistant in time that works action: huawei_solar.forcible_charge data: duration: 60 # time in minutes power: 2500 # power in W device_id: 6893ee838a0972bd3e50d9e0faa0ba5a

action: huawei_solar.forcible_discharge data: duration: 60 # time in minutes power: 2500 # power in W device_id: 6893ee838a0972bd3e50d9e0faa0ba5a

And to % action: huawei_solar.forcible_charge_soc data: device_id: 6893ee838a0972bd3e50d9e0faa0ba5a target_soc: 50 # target in % power: "1000"

JohanAlvedal avatar Sep 03 '24 04:09 JohanAlvedal

So you need to change your service templates e.g:

charge_start_service:
   duration: 60
   power:  {power}
   device_id: 6893ee838a0972bd3e50d9e0faa0ba5a

This should work.

springfall2008 avatar Sep 07 '24 14:09 springfall2008

Where this template is put ?

nargotik avatar Sep 09 '24 00:09 nargotik