gaetancollaud / digitalstrom-mqtt

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

Homeassistant (HA): Device status is not updated on HA when its updated by Button or ds App #38

Closed chini007 closed 1 year ago

chini007 commented 1 year ago

Hello,

I have plugged in my dsServer to HA using mqtt, and i can operate all the devices from HA. But if i switch on the physical button or switch on using dsApp, the device state is updated in HA.

Regards Srini

chini007 commented 1 year ago

I updated the MQTT_RETAIN=false and it works as expected. So now when I update the state from dsApp or Physical switch I can see the state updated in HA as well.

I was testing / snooping using MQTT explorer and I realized with "MQTT_RETAIN=true", it was always filtering and showing as "Retained".

Does this change makes sense?

gaetancollaud commented 1 year ago

Hey,

Please use a mqtt tool like https://mqtt-explorer.com/ to see what's really happening (or not) when you switch a device.

The retain option should have no effect in my opinion. MQTT_RETAIN=true means that the mqtt values will "persist" and the last known values will be retrieved everytime you susbribe to a topic.

It may happen that the digitalstrom platfom fail to send notifications when something change on the system. Usually a simple restart of the digitalstrom-mqtt software do the trick (maybe that's what happened).

chini007 commented 1 year ago

Hey Gaetan,

Thanks for the response.

I did try with MQTT explorer, but couldnt spot the difference. I have already restarted digitalstrom-mqtt pod multiple times. I dont know whether running this inside a pod is creating some issue, but when I through HA it does work, so it cant be the pod setup.

Regards Srini

gaetancollaud commented 1 year ago

By pod I guess you're running inside Kubernetes ? I don't think the network should be an issue since it's just http calls.

Is your problem solved ? Can we close this issue ? If not, do you have a way to reproduce it ?

chini007 commented 1 year ago

Yes its running inside Kubernetes. And it happens very often. But once it starts working it works until the server is running, as currently. And after restart, if it stops works it stays like that till next restart.

I tried replicating with different options, but no luck :(

gaetancollaud commented 1 year ago

Ok let me know if you have a reproducer.

Unfortunately, I'm currently unable to work on this before december, but I planned to work on the new DigitalStrom API (see #34 ) I hope it will help your case.

chini007 commented 1 year ago

Ok let me know if you have a reproducer.

Unfortunately, I'm currently unable to work on this before december, but I planned to work on the new DigitalStrom API (see #34 ) I hope it will help your case.

Ok no issues, currently when it starts working, it keeps working, and generally my pods doesnt go down, so I can manage, please let me now when you start on new APIs, if needed I can help and contribute a bit