joba-1 / Tasmoticz

Domoticz MQTT autodiscovery plugin for Tasmota devices
MIT License
24 stars 18 forks source link

Domoticz Switch State not updated after switching #28

Open Pace17881 opened 2 years ago

Pace17881 commented 2 years ago

Hi,

Thanks for this plugin. It makes it very easy to integrate my devices to domoticz.

But there is one issue. If I switch a device to ON or OFF the switch state gets not updated. If I refresh the browser it gets updated.

Do you have an idea what is the reason for this.

Thanks bg Sebastian

joba-1 commented 2 years ago

it is definitely meant to work and did work at one point. Since I didn‘t change the code, it is probably a change on tasmota or domoticz side. Which versions of tasmota and domoticz do you use? I‘ll try and replicate the error to fix it.

joba-1 commented 2 years ago

Just to clarify: The update on the domoticz web page should happen. Not on the tasmota web page.

Pace17881 commented 2 years ago

Tasmota Version: 11.0.0.4 Domoticz Version: 2022.1 (build 14271) Eclipse mosquitto Version: 2.0.14

I use latest docker for domoticz and mosquitto: `version: "3" services: domoticz: image: domoticz/domoticz container_name: domoticz restart: unless-stopped

Pass devices to container

# devices:
#   - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
ports:
  - "8080:8080"
networks:
  - automation
volumes:
  - /opt/docker/iot/domoticz/config:/opt/domoticz/userdata
  - /opt/docker/iot/domoticz/plugins:/opt/domoticz/plugins
environment:
  - TZ=Europe/Amsterdam
  - LOG_PATH=/opt/domoticz/userdata/domoticz.log

mosquitto: image: eclipse-mosquitto container_name: mosquitto restart: always networks:

mqtt config: persistence true persistence_location /mosquitto/data/ log_dest file /mosquitto/log/mosquitto.log listener 1883 0.0.0.0 allow_anonymous true

joba-1 commented 2 years ago

tested with tasmota 6.6.0.3, 11.0.0, 11.0.0.3 and now .4. I tested with domoticz page on ios and tasmota on android and the other way round to make sure swiping does not update the pages. I always see instant updates on the domoticz page if I toggle on a tasmota page. I don't doubt you see what you describe, so I guess it is my old 2020.2 domoticz that makes the difference. Are you using a public or a self made docker image? Or even better: Do you have commands for me to start this version on my docker?

joba-1 commented 2 years ago

I’ve just seen it when only using one ios device. If I toggle on tasmota and then swipe to domoticz I don’t see the update. On android this works fine - puzzled…

Pace17881 commented 2 years ago

I use the default docker images from Dockerhub for eclipse-mosquitto and domoticz Please follow the steps to run the instances. This works only on linux systems. (Because of the paths)

  1. Check if docker-compose is installed,
  2. Create the file docker-compose.yml in a directory of your choice
  3. Paste the following into the file:

`version: "3" services: domoticz: image: domoticz/domoticz container_name: domoticz restart: unless-stopped ports:

  1. Check indentation and save the file
  2. create in the same directory the file mosquitto.conf
  3. Paste the following into the file and save it:

persistence true persistence_location /mosquitto/data/ log_dest file /mosquitto/log/mosquitto.log listener 1883 0.0.0.0 allow_anonymous true

  1. run docker-compose up -d
  2. Then clone your plugin repository to /opt/docker/iot/domoticz/config/plugins
  3. Maybe you have to restart the domoticz container...
joba-1 commented 2 years ago

thanks, should be able to do that on my linux box. But has to wait a bit…

joba-1 commented 2 years ago

I’ve just seen it when only using one ios device. If I toggle on tasmota and then swipe to domoticz I don’t see the update. On android this works fine - puzzled…

it seems this problem on ios was due to temporary wlan connection problems (I run some dev openwrt image on my not yet officially supported routers, so that happens pretty frequently). When connection is fine, I cannot reproduce the issue.

P.S.: no time for docker games yet