Thomas55555 / husqvarna_automower

Custom component for Home Assistant to monitor and control your Husqvarna Automower
https://github.com/Thomas55555/husqvarna_automower
MIT License
105 stars 28 forks source link

Failed to call service husqvarna_automower.calendar. Command not allowed. #483

Closed robertoash closed 1 year ago

robertoash commented 1 year ago

Prerequirements [X] I have connected my mower(s) to the Automower Connect App [X] I have connected my Husqvanra developers account to the Authentication API [X] I have connected my Husqvarna developers account to the Automower Connect API

Describe the bug Calling the husqvarna_automower.calendar service produces "Failed to call service husqvarna_automower.calendar. Command not allowed." I followed the exact example in the Readme. The only thing I modified is the target entity. The same result occurs even with hardcoded times instead of templates.

Expected behavior I think it should be able to set a calendar using this service call.

Screenshots This is the call service I used:

image

And this is the error:

image

Additional context Log extract:

2023-06-06 01:20:21.484 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-06-06 01:20:21.485 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2023-06-06 01:20:21.607 ERROR (MainThread) [custom_components.husqvarna_automower.vacuum] Command couldn't be sent to the command que: 400, message='Bad Request', url=URL('https://api.amc.husqvarna.dev/v1/mowers/f75221ab-24d7-49d2-b7b0-089bf6031439/calendar')
2023-06-06 01:20:21.612 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: Command not allowed
2023-06-06 01:20:21.617 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547707877024] Error handling message: Command not allowed (unknown_error) Roberto from 127.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36)
Thomas55555 commented 1 year ago

Hi, There are some possible reasons:

  1. Have you checked, whether the sun entities exist on your system?
  2. Maybe your living above the polar circle, so there is no sunset and sunrise right now?
  3. Some mowers, which are on mission don't support changing the schedule. See #452 . Which mower do you have and is it using mission?
robertoash commented 1 year ago

Hi,

There are some possible reasons:

  1. Have you checked, whether the sun entities exist on your system?

Yes. The templates produce the desired output.

  1. Maybe your living above the polar circle, so there is no sunset and sunrise right now?

Creative troubleshooting. Love it!

But no. Don't live above the polar circle and the sun entities have values.

  1. Some mowers, which are on mission don't support changing the schedule. See #452 . Which mower do you have and is it using mission?

This might be the reason. Same as in the referenced issue, I have a 415x with a single zone configured but, as the referenced issue mentions, maybe it's a matter of my mower supporting missions. Maybe you want to mark this as a duplicate and I'll keep an eye out for the linked issue instead.

Thank you so much for looking into it and replying!

Thomas55555 commented 1 year ago

Duplicate to #452