DasBasti / SmartHashtag

Homeassistant component for Smart #1/#3 API
MIT License
33 stars 1 forks source link

API call to start/stop charging and discharging #125

Open p-manent opened 1 month ago

p-manent commented 1 month ago

Hello Bastian,

do you know if there is any API switch to start/stop charging and discharging (new from Smart OS 1.4)

The #1/#3 now supports V2L At the moment you need to "press the discharging button" manually to start discharging.

It would be great to start/stop this (also even the charging) via the API

DasBasti commented 1 month ago

I will look into it. Thanks for the information!

chriscatuk commented 1 month ago

that is what we used in hello # to start and stop charging

        let path = "/remote-control/vehicle/telematics/" + vin

        let timeStamp = String(Date().millisecondsSince1970)

        let serviceParameters: [[String: Any]] = [
            [
                "key": "operation",
                "value": start ? "1" : "0"
            ],
            [
                "key": start ? "rcs.restart" : "rcs.terminate",
                "value": "1"
            ]
        ]

        let json: [String: Any] = [
            "command": "start",
            "creator": "tc",
            "operationScheduling": [
                "scheduledTime": NSNull(),
                "interval": 0,
                "occurs": 1,
                "recurrentOperation": 0,
                "duration": 6
            ],
            "serviceId": "rcs",
            "serviceParameters": serviceParameters,
            "timeStamp": timeStamp
        ]
p-manent commented 1 month ago

Hello Chris,

I know it´s not yet in the hello app but is there a possibility to start/stop "discharge", too?

chriscatuk commented 3 weeks ago

Hello Chris,

I know it´s not yet in the hello app but is there a possibility to start/stop "discharge", too?

I will try guessing what API request could work. There's nothing yet in the official app to capture.

In SmartOS 1.4.0 The power is not even showing. It stays at 0 amps. I will check with 1.4.1