uni-meter icon indicating copy to clipboard operation
uni-meter copied to clipboard

Outbound websocket support

Open MuellBin2 opened this issue 1 year ago • 49 comments

We should add an active output websockets as used by APSystems' EZHI. As I described the actions are the following:

  1. Binding
  2. Connecting
  3. Sending data

The Uni-meter needs to answer its details on /shelly

  "id": "shellypro3em-b827eb364242",
         "mac": "b827eb364242",
        "model": "SPEM-003CEBEU120",
        "gen": 2,
        "fw_id": "20210720-153353/0.6.7-gc36674b",
        "ver": "0.6.7",
        "app": "FourPro",
        "auth_en": "false",
         "auth_domain": "shellypro4pm-b827eb364242"

Websocket is called at /rpc/Ws.SetConfig

config = request.args.get('config', type=str)
  "status": "success",
 "message": f"Config set successfully: {config}"

/rpc/Shelly.Reboot is called to finalize the binding process and the Uni-meter needs to take over the IP adress of the binding process

{         "code": 200,
            "message": "OK",
            "headers": {
        "Connection": "close",
        "Content-Length": "4",
        "Content-Type": "application/json",
        "Server": "ShellyHTTP/1.0.0"
  },
 + "body": "null"

finally, the Uni-meter pushes the consumption values to the new subscriber at /meter:

                "time": int(time.time()),  # UNIX timestamp
                "freq": 50,  # Frequency
                "total_power":  a b and c values  # Total system power
                "emeters": a b and c values  # Three phases

I suggest, this happens every 2 seconds (that is, at least, the input rate of the Pulse IR meter)

MuellBin2 avatar Mar 03 '25 18:03 MuellBin2

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.config.annotation.*;
import org.springframework.web.socket.handler.TextWebSocketHandler;

import java.io.IOException;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;

@SpringBootApplication
@RestController
public class ShellyEmulatorApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShellyEmulatorApplication.class, args);
    }

    private static final List<WebSocketSession> sessions = new CopyOnWriteArrayList<>();

    @GetMapping("/rpc/Ws.SetConfig")
    public Map<String, Object> setWsConfig(@RequestParam(required = false) String config) {
        if (config == null || config.isEmpty()) {
            return Map.of("status", "error", "message", "Config parameter is missing");
        }
        return Map.of("status", "success", "message", "Config set successfully: " + config);
    }

    @GetMapping("/rpc/Shelly.Reboot")
    public Map<String, Object> reboot() {
        return Map.of(
                "code", 200,
                "message", "OK",
                "headers", Map.of(
                        "Connection", "close",
                        "Content-Length", "4",
                        "Content-Type", "application/json",
                        "Server", "ShellyHTTP/1.0.0"
                ),
                "body", "null"
        );
    }

//At this point the live power data needs to be imported, I just used dummy values for my test.
    @GetMapping("/rpc/Shelly.GetStatus")
    public Map<String, Object> getStatus() {
        return Map.of("emeters", List.of(
                Map.of("power", 10, "voltage", 230, "current", 0.4),
                Map.of("power", 9, "voltage", 231, "current", 0.3),
                Map.of("power", 11, "voltage", 229, "current", 0.4)
        ));
    }

    @GetMapping("/shelly")
    public Map<String, Object> getDeviceInfo() {
        return Map.of(
                "id", "shellypro3em-b827eb364242",
                "mac", "b827eb364242",
                "model", "SPEM-003CEBEU120",
                "gen", 2,
                "fw_id", "20210720-153353/0.6.7-gc36674b",
                "ver", "0.6.7",
                "app", "FourPro",
                "auth_en", "false",
                "auth_domain", "shellypro4pm-b827eb364242"
        );
    }

    // Sending the data out for every 2000ms, contains dummy data yet. May need some closer debugging, this part did not work yet.
    @Scheduled(fixedRate = 2000)
    public void sendMeterData() {
        if (sessions.isEmpty()) return;

        Map<String, Object> data = Map.of(
                "time", System.currentTimeMillis() / 1000,
                "freq", 50,
                "total_power", 30,
                "emeters", List.of(generateEmeterData(), generateEmeterData(), generateEmeterData())
        );

        String jsonData = new com.fasterxml.jackson.databind.ObjectMapper().writeValueAsString(data);
        for (WebSocketSession session : sessions) {
            try {
                session.sendMessage(new TextMessage(jsonData));
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    private Map<String, Object> generateEmeterData() {
        return Map.of(
                "voltage", 230,
                "current", 0.4,
                "power", 10,
                "reactive_power", 0,
                "apparent_power", 0,
                "pf", 0.99,
                "total", 100
        );
    }

    @Configuration
    @EnableWebSocket
    public static class WebSocketConfig implements WebSocketConfigurer {
        @Override
        public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
            registry.addHandler(new ShellyWebSocketHandler(), "/meter").setAllowedOrigins("*");
        }
    }

    public static class ShellyWebSocketHandler extends TextWebSocketHandler {
        @Override
        public void afterConnectionEstablished(WebSocketSession session) {
            sessions.add(session);
        }

        @Override
        public void afterConnectionClosed(WebSocketSession session, org.springframework.web.socket.CloseStatus status) {
            sessions.remove(session);
        }
    }
}

I tried to convert my Python into Java, hope it may help.

The IP of the receiving device is also not stored yet. Maybe it should be implemented via the config file for a first test.

MuellBin2 avatar Mar 05 '25 09:03 MuellBin2

Hi, it took some time but I have build a first version including outbound websocket support :-)

You can either download the github packet: uni-meter-1.1.1-OUTBOUND.tgz

Or use a docker package:

sdeigm/uni-meter-1.1.1-OUTBOUND

Since I have neither a real Shelly Pro3EM nor your EZHI device, the version is just based on synthetic tests I have created myself. So I think it will be a little bit of ping-pong and takes some iterations between you and me until it finally works. Would be good if you can trace some debug logs containing the problems.

You can find the source code of the changes in branch 64-feature-request-add-websocket-subscription-support

sdeigm avatar Mar 10 '25 08:03 sdeigm

Alright, I pulled the Docker and set it up from the old configuration. EZHI just enabled "SHEM-3" next to Shelly Pro 3EM. Just a side Info.

The Uni-Meter is not being found out of the box, I will go deeper into the settings now and check what I can find out.

MuellBin2 avatar Mar 11 '25 10:03 MuellBin2

So, first thing. Logging is still on Debug level. When I search for Shelly devices in the EZHI, I do not get any output on the Uni-Meter 1.1.1.

25-03-11 11:07:31.157 INFO  uni-meter                - ##################################################################
25-03-11 11:07:31.159 INFO  uni-meter                - # Universal electric meter converter 1.1.0 (2025-03-01 09:54:53) #
25-03-11 11:07:31.160 INFO  uni-meter                - ##################################################################
25-03-11 11:07:31.160 INFO  uni-meter                - initializing actor system
25-03-11 11:07:31.727 INFO  org.apache.pekko.event.slf4j.Slf4jLogger - Slf4jLogger started
25-03-11 11:07:32.236 INFO  uni-meter.controller     - creating ShellyPro3EM output device
25-03-11 11:07:32.263 INFO  uni-meter.controller     - creating VZLogger input device
25-03-11 11:07:34.088 INFO  uni-meter.http.port-80   - HTTP server is listening on /[0:0:0:0:0:0:0:0]:80
...
25-03-11 11:09:31.612 ERROR uni-meter.input          - failed to execute polling: Tcp command [Connect(127.0.0.1/<unresolved>:8088,None,List(),Some(10 seconds),true)] failed because of java.net.ConnectException: Connection refused
...
25-03-11 11:13:07.549 ERROR uni-meter.input          - failed to execute polling: Tcp command [Connect(127.0.0.1/<unresolved>:8088,None,List(),Some(10 seconds),true)] failed because of java.net.ConnectException: Connection refused
25-03-11 11:14:33.172 ERROR uni-meter.input          - failed to execute polling: Tcp command [Connect(127.0.0.1/<unresolved>:8088,None,List(),Some(10 seconds),true)] failed because of java.net.ConnectException: Connection refused
25-03-11 11:16:53.828 ERROR uni-meter.input          - failed to execute polling: Tcp command [Connect(127.0.0.1/<unresolved>:8088,None,List(),Some(10 seconds),true)] failed because of java.net.ConnectException: Connection refused

(There seems to be an Problem with the Tibber Pulse getting the values, it is reachable via local APi though)

MuellBin2 avatar Mar 11 '25 11:03 MuellBin2

I think there are multiple things wrong in your setup. First your are not pulling the docker container that supports outbound websockets. You should modify your docker-compose files as below:

Image

Then the logging output should look like (also with a version 1.1.1-OUTBOUND in the header line)

 uni-meter Pulled
 Container uni-meter  Recreate
 uni-meter Published ports are discarded when using host network mode
 Container uni-meter  Recreated
Attaching to uni-meter
uni-meter  | 25-03-11 11:27:11.998 INFO  uni-meter                - ###########################################################################
uni-meter  | 25-03-11 11:27:12.000 INFO  uni-meter                - # Universal electric meter converter 1.1.1-OUTBOUND (2025-03-10 08:59:19) #
uni-meter  | 25-03-11 11:27:12.000 INFO  uni-meter                - ###########################################################################
uni-meter  | 25-03-11 11:27:12.000 INFO  uni-meter                - initializing actor system
uni-meter  | 25-03-11 11:27:12.275 INFO  org.apache.pekko.event.slf4j.Slf4jLogger - Slf4jLogger started
uni-meter  | 25-03-11 11:27:12.390 INFO  uni-meter.controller     - creating ShellyPro3EM output device

The last thing: you have configured your system to use a VzLogger input device. If you want to use a Tibber Pulse bridge, please use a config file like I have just provided unter samples: uni-meter.conf

sdeigm avatar Mar 11 '25 11:03 sdeigm

If that works as expected, it would be good if you could trace the problems using the following logging setup:

Image

Looking forward to your results and findings :-)

sdeigm avatar Mar 11 '25 11:03 sdeigm

Hm strange should be 1.1.1. Also it is not reading my config file. I think I need to reacreate the Docker from screatch, it doesn't contain what it says:

{
AppArmorProfile:"docker-default"
Args:[]
Config:{
AttachStderr:false
AttachStdin:false
AttachStdout:false
Domainname:""
Entrypoint:[
]
Env:[
]
Hostname:"shellypro3em-B827EB364242"
**Image:"sdeigm/uni-meter:1.1.1-OUTBOUND"**
Labels:{}
MacAddress:"B8:27:EB:36:42:42"
OpenStdin:true
StdinOnce:false
Tty:true
User:""
WorkingDir:""
}
Created:"2025-03-11T10:58:13.666784682Z"

MuellBin2 avatar Mar 11 '25 11:03 MuellBin2

Or use a docker package:

sdeigm/uni-meter-1.1.1-OUTBOUND

Are you shure this contains the right version? even after recreation and pulling this sdeigm/uni-meter:1.1.1-OUTBOUND, it still comes up the 1.1.0:

25-03-11 11:47:52.737 INFO  uni-meter                - ##################################################################
25-03-11 11:47:52.742 INFO  uni-meter                - # Universal electric meter converter 1.1.0 (2025-03-01 09:54:53) #
25-03-11 11:47:52.742 INFO  uni-meter                - ##################################################################
25-03-11 11:47:52.742 INFO  uni-meter                - initializing actor system
25-03-11 11:47:53.486 INFO  org.apache.pekko.event.slf4j.Slf4jLogger - Slf4jLogger started
25-03-11 11:47:53.772 INFO  uni-meter.controller     - creating ShellyPro3EM output device
25-03-11 11:47:53.788 INFO  uni-meter.controller     - creating VZLogger input device

I am pretty sure the docker container was pulled correctly. I see a small size deviation at docker-hub.

"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" "VERSION=1.1.1-OUTBOUND"

I think an old container is still run inside the docker: -jar /opt/uni-meter/lib/uni-meter-1.1.0.jar

called from opt\uni-meter\bin\uni-meter.sh

MuellBin2 avatar Mar 11 '25 11:03 MuellBin2

No, there must be something wrong with your docker compose file. I tested it now with both versions x64 and arm64. The correct version from hub.docker.com should print 1.1.1-OUTBOUND in the second line of the log:

Image

Perhaps there is an old container running in your environment, then please use docker ps and docker kill to get rid of that container.

And there should also be a message "creating TibberPulse input device" if you configured the uni-meter to use Tibber:

Image

sdeigm avatar Mar 11 '25 12:03 sdeigm

Image

I really dont belive this anymore 😄 . I have the two images locally. I deleted the 1.1.0 Image, then I run the 1.1.1 Image. Still it shows me version 1.1.0 when I start it up. I think my docker is the probleme here oO, lemme fix that ...

MuellBin2 avatar Mar 11 '25 12:03 MuellBin2

Ok I found the issue, i was mounting /opt with all its sub folder obviously containing version 1.1.0 .. typicall level 8 mistake ;)

so its now up and running, values are correct. Logging is on TRACE.

Maybe I need to configure logs longer. But it start up good, let me put down the interval so we don't have too many tibber messages inside the trace file.

StartUp:

25-03-11 12:46:01.707 INFO  uni-meter                - ###########################################################################
25-03-11 12:46:01.709 INFO  uni-meter                - # Universal electric meter converter 1.1.1-OUTBOUND (2025-03-10 08:59:19) #
25-03-11 12:46:01.709 INFO  uni-meter                - ###########################################################################
25-03-11 12:46:01.710 INFO  uni-meter                - initializing actor system
25-03-11 12:46:02.353 INFO  org.apache.pekko.event.slf4j.Slf4jLogger - Slf4jLogger started
25-03-11 12:46:02.985 TRACE uni-meter.controller     - UniMeter.createHttpServerController()
25-03-11 12:46:02.996 TRACE uni-meter.controller     - UniMeter.createOutput()
25-03-11 12:46:03.009 INFO  uni-meter.controller     - creating ShellyPro3EM output device
25-03-11 12:46:03.033 TRACE uni-meter.controller     - UniMeter.createInput()
25-03-11 12:46:03.038 INFO  uni-meter.controller     - creating TibberPulse input device
25-03-11 12:46:03.666 TRACE uni-meter.input          - Pulse.executePulseStatusPolling()
25-03-11 12:46:03.877 TRACE uni-meter.controller     - UniMeter.onRegisterHttpRoute()
25-03-11 12:46:03.886 TRACE uni-meter.output         - Shelly.startUdpServer()
25-03-11 12:46:03.891 TRACE uni-meter.http.port-80   - HttpServer.onRegisterRoute()
25-03-11 12:46:03.892 TRACE uni-meter.http.port-80   - HttpServer.start()
25-03-11 12:46:04.273 TRACE uni-meter.output         - ShellyPro3EM.onWrappedUdpServerNotification()
25-03-11 12:46:04.279 DEBUG uni-meter.output         - UDP server output Actor[pekko://uni-meter/user/output/StreamSupervisor-1/$$a-actorRefSource#1698272688]
25-03-11 12:46:04.280 TRACE uni-meter.output         - ShellyPro3EM.onWrappedUdpServerNotification()
25-03-11 12:46:04.280 DEBUG uni-meter.output         - UDP server initialized
25-03-11 12:46:04.344 TRACE uni-meter.output         - ShellyPro3EM.onWrappedUdpServerNotification()
25-03-11 12:46:04.345 INFO  uni-meter.output         - UDP server is listening on /[0:0:0:0:0:0:0:0]:1010
25-03-11 12:46:04.562 TRACE uni-meter.http.port-80   - HttpServer.onNotifyBindSuccess()
25-03-11 12:46:04.562 INFO  uni-meter.http.port-80   - HTTP server is listening on /[0:0:0:0:0:0:0:0]:80
25-03-11 12:46:08.866 TRACE uni-meter.input          - Pulse.onPulseStatusRequestSuccess()
25-03-11 12:46:08.869 TRACE uni-meter.input          - Pulse.handlePulseStatusEntity()
25-03-11 12:46:08.890 DEBUG uni-meter.input          - Found tag OPEN_RESPONSE
25-03-11 12:46:08.890 DEBUG uni-meter.input          - Found tag GET_LIST_RESPONSE
25-03-11 12:46:08.892 DEBUG uni-meter.input          - Found OBIS code 01 00 60 32 01 01
25-03-11 12:46:08.894 DEBUG uni-meter.input          - Found OBIS code 01 00 60 01 00 FF
25-03-11 12:46:08.896 DEBUG uni-meter.input          - Found OBIS code 01 00 01 08 00 FF
25-03-11 12:46:08.903 DEBUG uni-meter.input          - Energy Import (Wh): 2559557.8000000003
25-03-11 12:46:08.903 DEBUG uni-meter.input          - Energy Export (Wh): 394042.7
25-03-11 12:46:08.903 DEBUG uni-meter.input          - Power (W): 32.09
25-03-11 12:46:08.903 TRACE uni-meter.input          - Pulse.startNextPulseStatusPollingTimer()
25-03-11 12:46:08.904 TRACE uni-meter.output         - OutputDevice.onNotifyTotalPowerData()
25-03-11 12:46:08.905 DEBUG uni-meter.output         - power phase 0: PowerData[power=10.7, apparentPower=10.7, powerFactor=1.0, current=0.05, voltage=230.0, frequency=50.0]
25-03-11 12:46:08.923 DEBUG uni-meter.output         - power phase 1: PowerData[power=10.7, apparentPower=10.7, powerFactor=1.0, current=0.05, voltage=230.0, frequency=50.0]
25-03-11 12:46:08.924 DEBUG uni-meter.output         - power phase 2: PowerData[power=10.7, apparentPower=10.7, powerFactor=1.0, current=0.05, voltage=230.0, frequency=50.0]
25-03-11 12:46:08.925 TRACE uni-meter.input          - InputDevice.onWrappedOutputDeviceAck()
25-03-11 12:46:08.926 TRACE uni-meter.output         - OutputDevice.onNotifyTotalEnergyData()
25-03-11 12:46:09.918 TRACE uni-meter.input          - Pulse.onExecuteNextPulseStatusPolling()
25-03-11 12:46:09.918 TRACE uni-meter.input          - Pulse.executePulseStatusPolling()
25-03-11 12:46:09.983 TRACE uni-meter.input          - Pulse.onPulseStatusRequestSuccess()
25-03-11 12:46:09.984 TRACE uni-meter.input          - Pulse.handlePulseStatusEntity()
25-03-11 12:46:09.988 DEBUG uni-meter.input          - Found tag OPEN_RESPONSE
25-03-11 12:46:09.989 DEBUG uni-meter.input          - Found tag GET_LIST_RESPONSE
25-03-11 12:46:09.991 DEBUG uni-meter.input          - Found OBIS code .
25-03-11 12:46:09.993 DEBUG uni-meter.input          - Found OBIS code ...
25-03-11 12:46:10.000 DEBUG uni-meter.input          - Found OBIS code ...
25-03-11 12:46:10.008 DEBUG uni-meter.input          - Power (W): 32.09
...

MuellBin2 avatar Mar 11 '25 12:03 MuellBin2

https://www.dropbox.com/scl/fi/kj9ytd4lx7ynivt8jt42o/20250311-TraceFile_uni-meter.txt?rlkey=0s9pvomumzktt39avs8g668i4&dl=0

192.168.1.50 is running Home assist and other dockers, so should be ignored. 192.168.1.96 would be EZHI today.

I pushed the "search" button two times, but no request from EZHI are found. I can still connect the EZHI on my local Python implementation:

192.168.1.22 - - [11/Mar/2025 12:37:56] "GET /shelly HTTP/1.1" 200 - 192.168.1.22 - - [11/Mar/2025 12:37:58] "GET /rpc/Ws.SetConfig?config={"enable":true,"ssl_ca":%20"*","server":"ws://192.168.1.96/meter"} HTTP/1.1" 200 - 192.168.1.22 - - [11/Mar/2025 12:37:58] "GET /rpc/Shelly.Reboot HTTP/1.1" 200 -

The docker is running in bridge mode with its own IP 192.168.1.105, so all ports should be accessible

MuellBin2 avatar Mar 11 '25 12:03 MuellBin2

I manually pinged the docker container on the lookup: /shelly

<html><body>
<!--StartFragment--><div class="toolbar"><div class="devtools-separator"></div><div class="devtools-searchbox"><input class="searchBox devtools-filterinput" placeholder="Filter JSON" value=""></div></div><div class="panelContent" id="json-scrolling-panel" tabindex="0">
  |  
-- | --
type | "SPEM-003CEBEU120"
mac | "B827EB364242"
auth | false
fw | "20241011-114455/1.4.4-g6d2a586"
discoverable | true
longid | 1
num_outputs | 0
num_meters | 3

</div><!--EndFragment-->
</body>
</html>

In my implementation I have:

<html><body>
<!--StartFragment--><div class="toolbar"><div class="devtools-separator"></div><div class="devtools-searchbox"><input class="searchBox devtools-filterinput" placeholder="Filter JSON" value=""></div></div><div class="panelContent" id="json-scrolling-panel" tabindex="0">
  |  
-- | --
app | "FourPro"
auth_domain | "shellypro4pm-b827eb364242"
auth_en | "false"
fw_id | "20210720-153353/0.6.7-gc36674b"
gen | 2
id | "shellypro3em-b827eb364242"
mac | "b827eb364242"
model | "SPEM-003CEBEU120"
ver | "0.6.7"

</div><!--EndFragment-->
</body>
</html>

That auth information etc needs to be added

MuellBin2 avatar Mar 11 '25 13:03 MuellBin2

I think you are right, the EZHI is not happy with the response from the http://<shelly-ip>/shelly command. In you log I can see, that this funtion is triggered once:

25-03-11 12:49:16.737 TRACE uni-meter.output         - Shelly.onShellyGet()

If I am using a normal HTTP browser and send this request to my local uni-meter, I am getting the following answer:

{
    "type": "SPEM-003CEBEU120",
    "mac": "B827EB364242",
    "auth": false,
    "fw": "20241011-114455/1.4.4-g6d2a586",
    "discoverable": true,
    "longid": 1,
    "num_outputs": 0,
    "num_meters": 3
}

Can you please send this request http://<shelly-ip>/shelly to your implementation and post the received JSON here so that we can see what is different?

sdeigm avatar Mar 11 '25 13:03 sdeigm

<html><body>
<!--StartFragment--><div class="toolbar"><div class="devtools-separator"></div><div class="devtools-searchbox"><input class="searchBox devtools-filterinput" placeholder="Filter JSON" value=""></div></div><div class="panelContent" id="json-scrolling-panel" tabindex="0">
  |  
-- | --
type | "SPEM-003CEBEU120"
mac | "B827EB364242"
auth | false
fw | "20241011-114455/1.4.4-g6d2a586"
discoverable | true
longid | 1
num_outputs | 0
num_meters | 3

</div><!--EndFragment-->
</body>
</html>

yes, thats what I get

{ "type":"SPEM-003CEBEU120","mac":"B827EB364242","auth":false,"fw":"20241011-114455/1.4.4-g6d2a586","discoverable":true,"longid":1,"num_outputs":0,"num_meters":3 }

app | "FourPro" - I dont know what that is auth_domain | "shellypro4pm-b827eb364242" - maybe necessary auth_en | "false" - you have already fw_id | "20210720-153353/0.6.7-gc36674b" - you have already gen | 2 - maybe necessary? id | "shellypro3em-b827eb364242" - maybe necessary mac | "b827eb364242" - same model | "SPEM-003CEBEU120" - you named this "type". I remember i switched from "type" to "model" at some point in my implementation. ver | "0.6.7" - goes with the fw, maybe unnecessary.

MuellBin2 avatar Mar 11 '25 14:03 MuellBin2

Ok, seems to be different from the Shelly specification, but perhaps that has changed. I will adjust that accordingly.

sdeigm avatar Mar 11 '25 14:03 sdeigm

Ok, seems to be different from the Shelly specification, but perhaps that has changed. I will adjust that accordingly.

Be careful, ChatGTP created it using the specifications, but unnecessary data fields don't hurt

MuellBin2 avatar Mar 11 '25 14:03 MuellBin2

Perhaps the Pro3EM implements already this specification. That is closer to your output

sdeigm avatar Mar 11 '25 14:03 sdeigm

There is now an updated container 1.1.1-OUTBOUND2 on dockerhub.

That version should provide the following info on http://.../shelly:

{
    "id": "shellypro3em-b827eb364242",
    "mac": "B827EB364242",
    "slot": 1,
    "model": "SPEM-003CEBEU",
    "gen": 2,
    "fw_id": "20241011-114455/1.4.4-g6d2a586",
    "ver": "1.4.4",
    "app": "Pro3EM",
    "auth_en": false,
    "auth_domain": null,
    "profile": "triphase"
}

sdeigm avatar Mar 11 '25 14:03 sdeigm

yes, it appears now. But "binding failed" after selecting it. Let me traces this for you:

https://www.dropbox.com/scl/fi/z4h97it5mdhis13jr79ti/20250311-TraceFile_uni-meter.txt?rlkey=p2ejf3sl7sqko29unjoizfs0a&dl=0

Illegal request-target: Invalid input '{', expected query-char, pct-encoded or 'EOI' (line 1, column 27)

when I call .../rpc/Ws.SetConfig?config={"enable":true,"ssl_ca": "*","server":"ws://192.168.1.96/meter"}

Uni Meter needs to responds:

{
  "message": "Config set successfully: {\"enable\":true,\"ssl_ca\": \"*\",\"server\":\"ws://192.168.1.96/meter\"}",
  "status": "success"
}

WIth 192.168.1.96 being the client, EZHI in this case.

MuellBin2 avatar Mar 11 '25 14:03 MuellBin2