Smanar / CYD-Domoticz-Remote

WIP project to control your home-automation using Domoticz and a CYD (Cheap touchscreen).
9 stars 2 forks source link

With Websockets device status is not synchronized. #17

Closed SargonofAssyria closed 1 month ago

SargonofAssyria commented 1 month ago

Using the latest beta build 16150 and compile test branch with -DLIGHTWS The Status on the Domoticz light (On/Off) devices does not change on the display. Compiled with #-DLIGHTWS the status is displayed correctly.

Smanar commented 1 month ago

I can't reproduce it too. I m trying with a bulb, and the "on" appear" close the icon if I turn it on. (on Home panel) Or you mean in scene/group panel ? here it's possible having issue, not tested yet.

SargonofAssyria commented 1 month ago

It happens on the Home panel. I will try again and come back on this.

Smanar commented 1 month ago

ATM I m editing the code to support other panel.

SargonofAssyria commented 1 month ago

I switched back and forth on this setting with Websockets and Fastclic (Domoticz build 16150)

build_flags =
    -fexceptions
    -DPIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS
    -DLV_CONF_PATH="../../../../src/conf/lv_conf.h" # file path
    -DUSER_SETUP_LOADED=1 # To enable config throught platformio for TFT_eSPI
    -DFORCE_CONFIG # Enable or disable the forced network configuration.
    -DFORCECALIBRATE=false # Reset the calibration at every restart, used to reset it after a config change.
    #-DOLD_DOMOTICZ # If you are using older Domoticz version < 2023.2
    -DBONUSPAGE=0 # Special page to add, similar to Homepage but not updated, from 1 to 3
    -DFASTCLIC # Enable 1 clic action for some widget
    #-DNO_INFO_PAGE # Disable the Info panel
    #-DNO_GROUP_PAGE # Disable the Group/scene panel
    #-DCUSTOM_FONT
    #-DAUTO_BRIGHTNESS

    -DLIGHTWS # Only possible for version > 16088
    -DPUSHOTA # To enable Push OTA (Don't enable both OTA)
    #-DPULLOTA # To enable PUSH OTA (Don't enable both OTA)

The results is that both settings work fine, but with the -DLIGHTWS the screen on the device stays on the original status of the device at startup

Smanar commented 1 month ago

Have updated the code.

Have changed some stuff to WS but on my side.

The WS subscription stuff is new, perhaps I need to restart domoticz on my side (It have take around 20/30 subscription today ^^)

SargonofAssyria commented 1 month ago

Yes, WebSocket is now working as it should.

Smanar commented 1 month ago

And it's better for OTA on your side ? Not better on mine.

SargonofAssyria commented 1 month ago

That stop and delay on the OTA update did not work. I will stick to the manual reset after every OTA. That works. At the end updates will not be that frequent.

Smanar commented 1 month ago

I will stick to the manual reset after every OTA. That works.

You have an option to reset the device in the tool panel too.

SargonofAssyria commented 1 month ago

Yes, that is the one I use every time after an OTA update. SO I am fine.