Demanding the state of a device (Woox R7060)

Moderator: leecollings

peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Demanding the state of a device (Woox R7060)

Post by peterbos »

Hi,

I installed a Woox R7060 Smart Garden Irrigation Control last week and wrote a very simple dzVents script which switches the vent on two times a day with switchOn() and off with 10 minutes delay with switchOff().afterMin(10). I also added a switchOff().afterMin(12), in case the R7060 misses the first switchOff() command. The next morning we discovered the R7060 had been watering the garden for almost two hours. In the Domoticz log it said the R7060 was switched off 10 minutes after switching on, as in the dzVents script. But the state according to Domoticz logfile was not the real state. If I push one of the buttons of the R7060 the state changes in Domoticz so the R7060 can send changes.

Question is: does Domoticz calculate the state instead of demanding it from the R7060? And if so, is it possible the demand the real state from the R7060 in a dzVents script?

Peter
User avatar
waltervl
Posts: 5396
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by waltervl »

With what zigbee integration did you connect the device with Domoticz?
What happens if you switch the device on/off from the Domoticz user interface? Will the switch return to the real state if the command from the User interface was not received? Do you see errors there too?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by peterbos »

Hi Walter,

It's connected with Deconz/Conbee II. I tested the device at first from the user interface: that worked. I tested the buttons on the device: their status changed correctly in Domoticz. I connected the device to the tap and tested it again from the userinterface: it worked again. Then I wrote the script and activated it. I tested it one time by setting the start time to the current time: no problem. It started and stopped as expected. The next morning it soaked the garden... Unfortunately I was at the office so I could not check if the stop button worked (thus implicating that the device was still in start modus).

Peter
User avatar
waltervl
Posts: 5396
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by waltervl »

Did you see in the log the feedback that the off was ignored?
I had a bad behaving zigbee network once and then I cold see in the switch log on the device the off command by script or timer and 1 minute later the on command as the device/plugin reported that back.

But normally my zigbee devices act as expected.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by peterbos »

Hi Walter,

Thanks for your help. They sent me a new R7060, that I'm currently testing. I hope this one doesn't have the problem. I want to go back to my original question which was essentially: is it possible the demand the real state from the R7060 in a dzVents script? In human words: "hey R7060, tell me what your current state is", not a state that was calculated or received at an earlier moment.

Peter
User avatar
waltervl
Posts: 5396
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by waltervl »

Dzvents can only read what is the state of the device in Domoticz. If the current state in Domoticz is not the real state how should it know?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Kedi
Posts: 564
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by Kedi »

The coding of "I also added a switchOff().afterMin(12), in case the R7060 misses the first switchOff() command. " erases the first switchOff().afterMin(10) as far as I know. So there is no use for it.
I have a Woox R7060 for more than a year now and it works perfect. The real state of the device should be the same as in Domoticz because it is a zigbee device.
Because it is a battery powered device it does not send its state very often, but its state should stay synchronized with Domoticz as long as Domoticz stays up. I use zigbee2mqtt with mosquitto and retain set to true, so mosquitto holds the state of the Woox R7060

Perhaps share your script.
Last edited by Kedi on Friday 12 May 2023 19:19, edited 1 time in total.
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 5396
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by waltervl »

It is indeed the task of an hardware gateway/plugin to update the real state in Domoticz. So if this is not working ask the gateway plugin owner.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by peterbos »

Hi Kedi,
I have a Woox R7060 for more than a year now and it works perfect.
Today I started the test of a new R6070. It behaves the same as the other one.A snippet of the log data:

Code: Select all

13:00:00	100
13:10:00	0
13:15:00	100
13:25:00	0
13:30:00	100
13:40:00	0
13:45:00	100
13:55:00	0
13:55:08	100
13:55:13	0
14:00:00	100
The script is basic:

Code: Select all

return {
  on = {
    timer = {
      'every 15 minutes',
    }   
  },
  execute = function(dz, device)
    dz.devices('Sproeier 2').switchOn()
    dz.devices('Sproeier 2').switchOff().afterMin(10)
    dz.devices('Sproeier 2').switchOff().afterMin(12)
    dz.devices('Sproeier 2').switchOff().afterMin(14)
  end
}
The switch off at 13:10, 13:25 and 13:40 is okay, but the last one is not. The R7060 switches off, on and off again. In the log file I've never seen it switch off and on only but the first morning I used the R7060 that may have happened... Can you please check your log file. Maybe your devices have the same behavior - even though they seem to work well. Do you use some sort of control mechanism or is your script basically as simple as mine? Thanks in advance!

Peter
User avatar
waltervl
Posts: 5396
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by waltervl »

So what seems to happen is that Domoticz tried to switch off at 13:55 but 8 seconds later your conbee zigbee coordinator concluded that the device did not acknowledge the switchoff and pushed the real state (on) back to domoticz . After 5 seconds conbee switched it off again, as domoticz had no trigger to do so So this could be behavior of the device, the zigbee coordinator or the plugin.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Kedi
Posts: 564
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by Kedi »

Apparently you want to switch on for 10 min every 15 min.

Code: Select all

return {
  on = {
    timer = {
      'every 15 minutes',
    }   
  },
  execute = function(dz, device)
    dz.devices('Sproeier 2').switchOn().forMin(10)
  end
}
I myself use the Woox R7060 switch (ofcourse) and 2 (dummy) selector switches to control the Woox to turn it on on a specific time for a specific period to control watering my garden at night. I only use 1 line to switch on and 1 line to switch off. It works perfectly.
I will check the above code and come back.
Logic will get you from A to B. Imagination will take you everywhere.
Kedi
Posts: 564
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by Kedi »

I ran this code

Code: Select all

return {
  on = {
    timer = {
      'every 3 minutes',
    }
  },
  execute = function(dz, device)
    dz.devices('Buitenkraan').switchOn().forMin(1)
  end
}
And it runs perfectly every 3 minutes the Woox is switched on for 1 minute.
It really does not help if you do this extra:

Code: Select all

    dz.devices('Sproeier 2').switchOff().afterMin(12)
    dz.devices('Sproeier 2').switchOff().afterMin(14)
Logic will get you from A to B. Imagination will take you everywhere.
Kedi
Posts: 564
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by Kedi »

If you want to do real proper coding, it should be. (because the Woox might be on)

Code: Select all

return {
  on = {
    timer = {
      'every 3 minutes',
    }
  },
  execute = function(dz, device)
    if dz.devices('Buitenkraan').active then
      dz.devices('Buitenkraan').switchOff().afterMin(1)
    else
      dz.devices('Buitenkraan').switchOn().forMin(1)
    end
  end
}
Last edited by Kedi on Saturday 13 May 2023 13:20, edited 1 time in total.
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 5396
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by waltervl »

I think the Dzvents script is not the problem.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Kedi
Posts: 564
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by Kedi »

I think it does, and it does not harm to try my latest version, just for testing.....
Logic will get you from A to B. Imagination will take you everywhere.
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by peterbos »

Hi Kedi,

Although I agree with Walter about the script, I just started testing your script. I think the problem is in the device itself and suspect it not to switch first time right. I'm still curious whether your device is showing this behavior too. Can you please check your log data? It's visible in the text log data or in the percentage log data at the bottom of the device's log page.

Peter
Kedi
Posts: 564
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by Kedi »

My log shows exactly as the scripts instructs with an accuracy of 1 second.
And my Z2M logs shows exactly the same.
You talk about "percentage log data", mine is a normal switch with only On and Off.
This is exposed in Z2M by the Woox
13.05.2023_15.15.57_REC.png
13.05.2023_15.15.57_REC.png (11.53 KiB) Viewed 2223 times
Logic will get you from A to B. Imagination will take you everywhere.
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by peterbos »

Hi Kedi,

The percentage log shows 0% for Off and 100% for On. The problem is that the Download CSV and Download XLS functions of the Today and Last Week graphs only show the On times but not the Off times, see viewtopic.php?t=40349.

Peter
Kedi
Posts: 564
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by Kedi »

That is a totally different bug. I have that same issue about the 'Off' not present in CSV or Excel file.
I never noticed it, because I never used it.
But did you test this script???

Code: Select all

return {
  on = {
    timer = {
      'every 3 minutes',
    }
  },
  execute = function(dz, device)
    if dz.devices('Buitenkraan').active then
      dz.devices('Buitenkraan').switchOff().afterMin(1)
    else
      dz.devices('Buitenkraan').switchOn().forMin(1)
    end
  end
}
And what is the outcome??? You can find out in 20 minutes!!!
And put at the logging of dzVents debugging on.
Setup -> Settings -> Tab Other -> at the end loglevel Debug
What is the device type of your switch???
Mine is:
14.05.2023_09.27.05_REC.png
14.05.2023_09.27.05_REC.png (11.16 KiB) Viewed 2183 times
Logic will get you from A to B. Imagination will take you everywhere.
peterbos
Posts: 93
Joined: Saturday 07 November 2020 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Demanding the state of a device (Woox R7060)

Post by peterbos »

Hi Kedi,

Yes, I tried it but the logging still shows On-Off-On and Off-On-Off behavior. Unfortunately it's not possible to find out in 20 minutes because about 80% of the time it's first time right On or Off. That's why I'm interested in your logging: I want to know if your device shows the same behavior, even though you may not be aware of it. The only logging that shows the behavior is the text log (which is impossible to copy and paste) or the data of the percentage log. These datasets are the same. The other two graphs have incomplete data if you try to download it and yes, that's a different bug.

Peter
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests