gaetancollaud / digitalstrom-mqtt

Bridge between digitalSTROM and MQTT
GNU Affero General Public License v3.0
24 stars 4 forks source link

only getting meterings and server but no devices at all with v2? #47

Open holli73 opened 11 months ago

holli73 commented 11 months ago

hello,

i use 1.6 and react on the scene call's thats working ok - now i tried to use the new api but all I get is server/meterings but no devices at all within the mqtt tree?

any idea what could be wrong?

holli@mqtt-node-red:~/BUILD/DsS-to-mqtt/NewApi$ ./digitalstrom-mqtt
2023-12-18T18:14:49+01:00 INF Starting DigitalStrom MQTT!
2023-12-18T18:14:49+01:00 INF Starting controller.
2023-12-18T18:14:49+01:00 INF Updating server status topic status=online topic=server/status
2023-12-18T18:14:49+01:00 DBG Response received status="200 OK" url=https://192.168.245.1:8080/api/v1/apartment
2023-12-18T18:14:49+01:00 DBG Response received status="200 OK" url=https://192.168.245.1:8080/api/v1/apartment/meterings
2023-12-18T18:14:49+01:00 DBG Response received status="200 OK" url=https://192.168.245.1:8080/api/v1/apartment/status
2023-12-18T18:14:50+01:00 INF Starting module. module=meterings
2023-12-18T18:14:50+01:00 INF Starting module. module=devices
2023-12-18T18:15:00+01:00 DBG Updating metering values.
2023-12-18T18:15:00+01:00 DBG Response received status="200 OK" url=https://192.168.245.1:8080/api/v1/apartment/meterings/values
2023-12-18T18:15:10+01:00 DBG Updating metering values.
2023-12-18T18:15:10+01:00 DBG Response received status="200 OK" url=https://192.168.245.1:8080/api/v1/apartment/meterings/values
^C2023-12-18T18:15:16+01:00 INF Stopping controller.
2023-12-18T18:15:16+01:00 INF Stopping module. module=meterings
2023-12-18T18:15:16+01:00 INF Stopping module. module=devices
2023-12-18T18:15:16+01:00 INF Publishing Offline status to MQTT server.
2023-12-18T18:15:16+01:00 INF Updating server status topic status=offline topic=server/status
2023-12-18T18:15:16+01:00 INF Disconnected from MQTT server.
2023-12-18T18:15:16+01:00 ERR Websocket reading error error="read tcp 192.168.245.111:50762->192.168.245.1:8090: use of closed network connection"
2023-12-18T18:15:16+01:00 WRN Closing websocket reader
holli@mqtt-node-red:~/BUILD/DsS-to-mqtt/NewApi$

is shown - but no devices at all are visible - why is mqtt-user/pwd mandatory? (I do not use authentication for my mqtt server)

thanks holli

gaetancollaud commented 11 months ago

Hello,

Thanks for reporting the issue.

Have you tried physically pressing a button or changing the state of any devices ? Maybe there is an issue with REFRESH_AT_START that publish the initial state of all devices onces the app starts. I will have a look.

Regarding the required MQTT user/password that should not be mandatory I will have a look. But if you provide them with whatever value and your MQTT server is open, it may works.

gaetancollaud commented 11 months ago

@holli73 Please have a look at the version 2.0.3 that should solve the two problems mentioned above.

gaetancollaud commented 11 months ago

i use 1.6 and react on the scene call's thats working ok

By the way, this is a know limitation... Look at the migration guide for the work around. If you absolutely want scene events in MQTT you have to stick with 1.x that uses the legacy API. I've no idea why they remove this feature in the new API.

holli73 commented 11 months ago

hello,

with 2.0.3 i get now devices as well but the grouping is a bit strange - f.ex. i have a room called LivingRoom and in this room i have light device and 2 shade devices and all is on the root tree as documented - but the room itself has a brightness as well but this value is not changed - wouldn't it be better if all devices are in the grouping as already defined in dss? f.ex.: .../devices/RoomName/DeviceName/sub-elements

i use the digitalstrom devices as master switches and not in rooms - i created the room lights with vdcd/vdsm but these devices are not replicated but on these devices i have my scene call's defined (output - 100/75/50/25) - so with v2 it is impossilbe to react in my env. on any light change/scene call.

image

hope this makes sense

best regards holli

gaetancollaud commented 11 months ago

...wouldn't it be better if all devices are in the grouping as already defined in dss? f.ex.: .../devices/RoomName/DeviceName/sub-elements

I will not do that. My goal is to make abstraction of digitalstrom internal structure and just have plain devices.

So basically you use virtual devices and those are not listed in the v2. Were they in v1 ?

I understand your issue with the scenes but I've no solution for now. I suggest you stick to the v1.x until digitalstrom implement something in their new API.