endor-force/home-assistant-garo-chargebox

Can't get the switch for "mode setting" to work

KenBro55 opened this issue · 4 comments

Thank's for a nice tool set in order to avoid the Garo integration which seems to no longer being maintained!

However, I have problems to get the mode switch working.

First question is if there is a typo in the Readme. A bit down in the code for switch you have written:
command_state: '/usr/bin/curl -X GET http://192.168.xxx.yyy:2222/rest/chargebox/status'
But I assume also this line should change the url to:
command_state: '/usr/bin/curl -X GET http://192.168.xxx.yyy:8080/servlet/rest/chargebox/status'

But after correcting this, I still can't get the switch to work. Have you tried it with the Garo FW 1.3.1?

/Kenneth

You forgot to change the url to the new path (missed the "new" servlet bit). This exact snippet works for me on 1.3.1:

#Laddbox mode laddbox_mode: command_on: '/usr/bin/curl -X POST -H "Content-Type: application/json" -d "ALWAYS_ON" http://glb.h.snutt.net:8080/servlet/rest/chargebox/mode/ALWAYS_ON' command_off: '/usr/bin/curl -X POST -H "Content-Type: application/json" -d "ALWAYS_OFF" http://glb.h.snutt.net:8080/servlet/rest/chargebox/mode/ALWAYS_OFF' command_state: '/usr/bin/curl -X GET http://glb.h.snutt.net:8080/servlet/rest/chargebox/status' value_template: '{{ value_json.mode == "ALWAYS_ON" }}'

Updated readme.. Thanks for the heads up

Thank you Johan!

That did the trick :-)

Jonas, you just updated the first part with the wrong port and missing "servlet" in the path.
You also need to add "ALWAYS_ON" resp "ALWAYS_OFF" at the end of the url:s as in Johan's example in the ReadMe.

/Kenneth

Oh, my bad.
I have fixed it.. and while i was in there i refactored a lot of things. The template sensors should be moved outside sensors: and in to a new section called template to be more future proof.
Cleaned up a lot of things to reduce the size too