gaetancollaud / digitalstrom-mqtt

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

since 1.6.0 no scene call's are put on the mqtt #33

Closed holli73 closed 10 months ago

holli73 commented 2 years ago

image

holli73 commented 2 years ago

i did stop (kill -TERM) and restarted it - and now scene calls are showing up

image

gaetancollaud commented 2 years ago

Can you find a way to always reproduce this issue ?

I know that sometimes digitalstrom has issues with the subscriptions :( There is unfortunately not a lot I can do about it. Sometimes the registration of events is successful, but no event are received...

holli73 commented 2 years ago

looks like i can reproduce this - i have to start apx. 3 times till scene calls are received - what kind of log/trace would you need?

gaetancollaud commented 2 years ago

can you set the LOG_LEVEL to TRACE and give me everything just after you start.

Do you have other digitalstrom integrations? That could maybe conflict with this one?

holli73 commented 2 years ago

hello,

i use the https json endpoints to turn on/off devices

json/system/loginApplication?loginToken json/device/&ACTION#?dsuid=&DSUID#&token=&SESSIONTOKEN#

mostly for heating (black/blue) floor heating and infrared panels

i use the https://github.com/plan44/vdcd for bringing in all my temperature sensors into the dss and create all my deconz/zigbee devices through this integration within dss.

i tried xx times with trace level and it works all the time - so maybe this is just a timing issue? if i do not get scene calls - i did in the past a strace -p on the binary - and if this happens i can see on the console that the process is hanging on a socket read and not processing

futex(0xc000037150, FUTEX_WAKE_PRIVATE, 1) = 1
read(7, 0xc000490000, 2225)             = -1 EAGAIN (Resource temporarily unavailable)
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
futex(0xa48d30, FUTEX_WAIT_PRIVATE, 0, NULL

at the moment i'm running in trace mode and i did not get a segfault anymore and started/stopped the process xx times - so the change with 1.6.1 looks to be working fine

gaetancollaud commented 2 years ago

The socket hanging is by design. If you want to have real-time events you have to subscribe to some categories of events and then get the events. And the get events call will hang until something comes.

Good to know that the 1.6.1 solved it.

Regarding the subscription that sometimes doesn't work, I will investigate the timing issue (maybe we should wait between the subscribe and getEvent a bit, I don't know). I got the issue from time to time, but without a clear way of reproducing it, it's tough to debug...

Digitalstrom is working on a new API but I'm still waiting on it. I was able to make it kinda work but without official documentation I guess they can change it whenever they want so I decided not to use it. When it's ready it will opefully solve some issues.

DonFige commented 1 year ago

Hello. First of all, great integration. I am experiencing some problems with scenes. I tried to call them several times, but so far it seems they are not coming through. Compared to this thread I seem to be stuck one step before. Any hints? Should I open a new issue? Should it also send the status of the thermostats? I seem also not able to find them. Happy to test anything required.

gaetancollaud commented 1 year ago

Hello @DonFige, if you think it's related we can continue here, but if not, please open a new issue.

For thermostat, there is no integration so far (I don't have them so I cannot test them).

Unfortunatelly, I decided to quit my job and take a year to travel the world, so I will not be able to work on this integration before 2024. :( If someone is willing to have a look and fix it I can easily approve pull requests and make releases remotely.

holli73 commented 1 year ago

@DonFige - i still have this issue from time to time as well - that no scene calls are reported after starting - i use mqtt-explorer and once i start the interface to look for calls

-- kill running instance:
kill -TERM <pid>
-- start again
$PWD/digitalstrom-mqtt &

once the output is scrolling - look into mqtt-explorer - till it is available and then issue a scene call - if it shows up right away all is fine - exit the shell - done - if not kill again and start - i only have this situation on rebooting - after the first manual start - it works all the time.

gaetancollaud commented 10 months ago

This issue is obsolete as scene events are not used anymore