Page 7 of 8

Re: Tado Thermostat plugin

Posted: Saturday 27 September 2025 8:46
by sloeber70
Hi,

Just my thoughts:

I see this in the log : every 45 seconds I got 24 lines. I have 8 TADO devices. I assume that every devices counts for 1 poll.

Math:
    1440 minutes in a day x 60 secs = 86400 seconds total.
      8 devices = 8 polls.
        polling every 45 seconds
          total polls per day : 86400 /45 = 1920 * 8 devices = 15360 queries per day.

          If I set interval to 30 seconds, I will have to much polls = 23040
          So to set your polling interval, you should do the maths.

          Re: Tado Thermostat plugin

          Posted: Saturday 27 September 2025 12:01
          by jannl
          I am afraid your math does not add up. Not sure how to compute the number of devices, but I have 10 radiators with a Tado knob. That gives me 19200 polls but after around 20hrs I am done. So most likely at least the bridge counts as 1 drives as well.

          I will test with 60 seconds. As far as I can see setpoint settings are immediatly handled.

          But first have to wait for around 2 hours before the counter resets

          Re: Tado Thermostat plugin

          Posted: Sunday 28 September 2025 10:35
          by jannl
          In spite of the 60 seconds I set in the hardware tab, I notice the devices are updated every 30 seconds.

          Anyone know how this can be?

          Re: Tado Thermostat plugin

          Posted: Monday 29 September 2025 20:17
          by sloeber70
          Working as expected here : I did set the interval on 60 for testing. Also works as expected with 45 secs set.

          2025-09-29 20:13:37.333 TADO: Temp + Humidity (TADO BureelTemp)
          2025-09-29 20:13:37.335 TADO: General/Percentage (CV Bureel Verbruik)
          2025-09-29 20:13:37.593 TADO: Setpoint (CV Hall Vraag)
          2025-09-29 20:13:37.624 TADO: Temp + Humidity (TADO HallTemp)
          2025-09-29 20:13:37.635 TADO: General/Percentage (CV Hall Verbruik)
          2025-09-29 20:13:37.898 TADO: Setpoint (CV Slaapkamer Vraag)
          2025-09-29 20:13:37.909 TADO: Temp + Humidity (TADO SlaapkamerTemp)
          2025-09-29 20:13:37.912 TADO: General/Percentage (CV Slaapkamer Verbruik)
          2025-09-29 20:13:38.139 TADO: Setpoint (CV LivingHall Vraag)
          2025-09-29 20:13:38.158 TADO: Temp + Humidity (TADO LivingHallTemp)
          2025-09-29 20:13:38.163 TADO: General/Percentage (CV LivingHall Verbruik)
          2025-09-29 20:13:38.414 TADO: Setpoint (CV LivingThermostaat Vraag)
          2025-09-29 20:13:38.422 TADO: Temp + Humidity (TADO LivingThermostaatTemp)
          2025-09-29 20:13:38.425 TADO: General/Percentage (CV LivingThermostaat Verbruik)
          2025-09-29 20:13:38.671 TADO: Setpoint (CV LivingVenster Vraag)
          2025-09-29 20:13:38.698 TADO: Temp + Humidity (TADO LivingVensterTemp)
          2025-09-29 20:13:38.703 TADO: General/Percentage (CV LivingVenster Verbruik)
          2025-09-29 20:13:38.932 TADO: Setpoint (CV Badkamer Vraag)
          2025-09-29 20:13:38.936 TADO: Temp + Humidity (TADO BadkamerTemp)
          2025-09-29 20:13:38.942 TADO: General/Percentage (CV Badkamer Verbruik)
          2025-09-29 20:14:00.320 Status: Set UserVariable TADO Temp Control = Neen
          2025-09-29 20:14:00.473 Status: Set UserVariable TadoCounter = 9784
          2025-09-29 20:14:00.556 Status: Set UserVariable TadoCounter = 9784
          2025-09-29 20:14:39.507 TADO: Setpoint (CV Keuken Vraag)
          2025-09-29 20:14:39.511 TADO: Temp + Humidity (TADO KeukenTemp)
          2025-09-29 20:14:39.515 TADO: General/Percentage (CV Keuken Verbruik)
          2025-09-29 20:14:39.779 TADO: Setpoint (CV Bureel Vraag)
          2025-09-29 20:14:39.790 TADO: Temp + Humidity (TADO BureelTemp)
          2025-09-29 20:14:39.793 TADO: General/Percentage (CV Bureel Verbruik)
          2025-09-29 20:14:40.063 TADO: Setpoint (CV Hall Vraag)
          2025-09-29 20:14:40.067 TADO: Temp + Humidity (TADO HallTemp)
          2025-09-29 20:14:40.069 TADO: General/Percentage (CV Hall Verbruik)
          2025-09-29 20:14:40.310 TADO: Setpoint (CV Slaapkamer Vraag)
          2025-09-29 20:14:40.317 TADO: Temp + Humidity (TADO SlaapkamerTemp)
          2025-09-29 20:14:40.319 TADO: General/Percentage (CV Slaapkamer Verbruik)
          2025-09-29 20:14:40.576 TADO: Setpoint (CV LivingHall Vraag)
          2025-09-29 20:14:40.585 TADO: Temp + Humidity (TADO LivingHallTemp)
          2025-09-29 20:14:40.587 TADO: General/Percentage (CV LivingHall Verbruik)
          2025-09-29 20:14:40.844 TADO: Setpoint (CV LivingThermostaat Vraag)
          2025-09-29 20:14:40.866 TADO: Temp + Humidity (TADO LivingThermostaatTemp)
          2025-09-29 20:14:40.870 TADO: General/Percentage (CV LivingThermostaat Verbruik)
          2025-09-29 20:14:41.128 TADO: Setpoint (CV LivingVenster Vraag)
          2025-09-29 20:14:41.131 TADO: Temp + Humidity (TADO LivingVensterTemp)
          2025-09-29 20:14:41.133 TADO: General/Percentage (CV LivingVenster Verbruik)
          2025-09-29 20:14:41.376 TADO: Setpoint (CV Badkamer Vraag)
          2025-09-29 20:14:41.383 TADO: Temp + Humidity (TADO BadkamerTemp)
          2025-09-29 20:14:41.385 TADO: General/Percentage (CV Badkamer Verbruik)

          Re: Tado Thermostat plugin

          Posted: Tuesday 30 September 2025 7:27
          by jannl
          The 60 seconds seem to work now.

          Re: Tado Thermostat plugin

          Posted: Wednesday 01 October 2025 16:55
          by jannl
          Wrong obviously. Today I got the limit call again. Have copilot look at the code it says that every physical device delivers around 6 devices when polled, that would been even setting the poll time to 300 would not always be sufficient. Can some comment on this? Am I talking bs?

          Re: Tado Thermostat plugin

          Posted: Thursday 02 October 2025 18:58
          by sloeber70
          Hi,
          I only see 3 items polled per device.

          I've made a script to keep track of queries, assuming that every device counts for one poll.
          This is working fine. And as far as I can see: it is correct... or it should be that my restrictions are not applied yet. TADO said that the limitations would be implemented within a certain period of time.

          I did test my daily polls with this script/counter.. altering the polling period to 30 seconds, gets me restricted again.

          Script:
          Just create a virtual counter, name it, adapt the script to reflect that name and alter the violation message to the first device that is mentioned in the log when polling.
          Also create a variable to hold the updated queries number.
          I do reset at midnight.
          I do multiply the counter by 8, since I have 8 devices.
          running every minute.. therefore I use a 60 secs polling interval now.

          **** begin script ****
          myHttpResponse = "getDomoticzErrorLog"

          return {
          on = { httpResponses = { myHttpResponse },
          timer = { "every 1 minutes"},
          -- devices = { "getErrorTrigger"} -- Only used for development and testing
          },

          logging = { level = domoticz.LOG_FORCE,
          marker = "status TADO counter" },

          data = { lastlogtime = { initial = 0 }},

          execute = function(dz, trigger, timer)

          local violationMessage = "CV Hall Verbruik" -- Change to reflect the messages you want to catch
          local function askDomoticzForLogLines()
          local lastLogTime = dz.data.lastlogtime -- get time last logrequest
          local logLevel = 268435455 -- loglevel (1=normal,2=Status,4=error,268435455=all
          local jsonString = "/json.htm?type=command" ..
          "&param=getlog" ..
          "&lastlogtime=" .. tostring(lastLogTime) ..
          "&loglevel=" .. tostring(logLevel)

          local logURL = "http://10.10.3.2:9080" .. jsonString

          dz.openURL ({ url = logURL,
          method = "GET",
          callback = myHttpResponse
          })

          dz.data.lastlogtime = os.time(os.date('*t')) -- store current Time as seconds from epoch
          dz.log(logURL,dz.LOG_DEBUG)
          end

          local function findViolation()
          local violation = ""
          if trigger.json.result ~= nil then -- Only when there are errormessages in the log
          local resultTable = trigger.json.result
          for i = #resultTable,1,-1 do -- traverse backwards to get latest violation first
          if string.find(resultTable.message,violationMessage) and
          not(string.find(resultTable.message,"dzVents")) then -- We don't want debug messages to interfere
          violation = violation .. "\n".. resultTable.message
          end
          end
          end
          return violation
          end

          if trigger.isDevice or trigger.isTimer then
          askDomoticzForLogLines() -- get the relevant loglines
          elseif trigger.ok then
          local violation = findViolation()
          if violation == "" then
          dz.log("No (new) violations found",dz.LOG_FORCE)
          if (dz.time.matchesRule('between 00:00 and 00:01')) then
          dz.devices('TadoCounter').updateCustomSensor(0)
          dz.variables('TadoCounter').set(0)
          end
          else
          local tadocount = dz.variables('TadoCounter').value
          if (tadocount >= 20000) then
          dz.notify("TADO Counter: " .. tadocount .. "queries!!" ,violation, dz.PRIORITY_HIGH,nil,nil,dz.NSS_PUSHOVER)
          end
          local count = tadocount +8
          if (dz.time.matchesRule('between 00:00 and 00:01')) then
          dz.devices('TadoCounter').updateCustomSensor(0)
          dz.variables('TadoCounter').set(0)
          elseif (dz.time.matchesRule('between 00:01 and 00:02')) then
          dz.devices('TadoCounter').updateCustomSensor(16) -- set 0 at Midnight maar moet corrigeren
          dz.variables('TadoCounter').set(16)
          else
          dz.devices('TadoCounter').updateCustomSensor(count)
          dz.variables('TadoCounter').set(count)
          end
          end
          else
          dz.log("Access problem to log",dz.LOG_ERROR)
          end
          end
          }

          **** end script ****

          Result:

          Re: Tado Thermostat plugin

          Posted: Friday 03 October 2025 8:51
          by jannl
          Thx, I will check when I count 3 polls for every device.

          The script is dzvents, which I do not use (and never will), I am a plain lua guy, propably because dzvents didn't exist when I started using Domoticz.
          But I guess U will make a lua/bash/python/perl script to do the same in the future ;-)

          Re: Tado Thermostat plugin

          Posted: Saturday 04 October 2025 14:35
          by sloeber70
          hmmm looks that we have an intermittent problem..
          Banned again....

          ..... type-options: nosniffcontent-security-policy: frame-ancestors 'none'x-frame-options: DENYratelimit-policy: "perday";q=20000;w=86400ratelimit: "perday";r=0;t=26251....

          I will try to get it running with a HomeAssistant VM... = local queries.
          this is getting very annoying indeed...
          One day you get blocked.. another day it runs fine...

          Re: Tado Thermostat plugin

          Posted: Saturday 04 October 2025 18:22
          by sloeber70
          Counter has been reset at TADO ... still getting blocked when counter is lower then 20000.

          2025-10-04 18:21:15.929 Error: TADO: Failed to perform GET request to Tado Api: ; Response headers: HTTP/2 429 date: Sat, 04 Oct 2025 16:21:15 GMTcontent-length: 0vary: Originvary: Access-Control-Request-Methodvary: Access-Control-Request-Headersstrict-transport-security: max-age=31536000x-content-type-options: nosniffcontent-security-policy: frame-ancestors 'none'x-frame-options: DENYratelimit-policy: "perday";q=20000;w=86400ratelimit: "perday";r=0;t=1880

          Re: Tado Thermostat plugin

          Posted: Sunday 05 October 2025 10:52
          by jannl
          I now regularly get this message:

          Code: Select all

          2025-10-05 10:45:28.174 Error: Tado: Failed to perform GET request to Tado Api: {"errors":[{"code":"unauthorized","title":"access token is expired"}]}; Response headers: HTTP/2 401 date: Sun, 05 Oct 2025 08:45:28 GMTcontent-type: application/json;charset=UTF-8vary: origin,access-control-request-method,access-control-request-headers,accept-encodingcontent-encoding: gzip
          Sometimes it stops for some time. So far I can not pinpoint the cause.
          Setting a new token (by disabling/enabling the Tado hardware) solves it temporarely. It looks like everything keeps working, but still I hate error messages.

          Anyone has clue?

          I am on build 2025.1(16787)

          Edit: can it be that the refreshtoken interval and the poll interval interfere?
          Edit2: looking at the tado.cpp it looks like there is a loop of 12 (MAXLOOPS) after which the token is refreshed. The loop is run every poll interval, when the poll interval is set to something > lets say 60 seconds, the token is gone before the refresh (I think). Since my c++ knowledge is not that high (to say the least), can someone alter this in the code?
          Edit3: Given the 600second token lifetime, the poll interval should never be greater than 600 and de maxloops should not be higher than the 600/pollinterval. Additional downside is the spoiled poll every 10 minutes or so.

          Re: Tado Thermostat plugin

          Posted: Monday 06 October 2025 9:01
          by sloeber70
          HI,

          I have the same feeling.. I saw the refresh token error coming again, only 30 minutes after starting a fresh instance on my test domoticz yesterday. I did remove the API for 2 days, so the counters at TADO should have been on zero. I just think that the API counter is not registering at TADO as it should do.

          Maybe it is a strategy from TADO to completely outfase the API...

          Untill things are cleared I did remove the plugin. Only using TADO app.
          I will try to integrate things into Homekit for HomeAssistant.

          Re: Tado Thermostat plugin

          Posted: Monday 06 October 2025 16:46
          by jannl
          No, it is actually Domoticz not working correctly. Tado is not a plugin, it is Domoticz basic hardware.

          In a few weeks I may have some more time and dive into updating the tado.cpp/tado.h myselfif it is not already fixed.

          Besides the regular invalid token errors, the hardware works fine. Just take into account that the invalid token error can cause Domoticz to miss a command.

          Re: Tado Thermostat plugin

          Posted: Thursday 09 October 2025 22:49
          by heggink
          For those interested, I use the node red library to communicate with my Tado devices. Comms to domoticz is done by reading and posting mqtt msgs using autodiscovery (send discovery message, read/write topics).
          Happy to share if anyone is interested. I only have one thermostat but the basic principle is there.

          Re: Tado Thermostat plugin

          Posted: Friday 10 October 2025 0:17
          by sloeber70
          Hi,

          Yes please. I would love to see how it is done.
          THX !!!

          Re: Tado Thermostat plugin

          Posted: Friday 10 October 2025 10:36
          by jannl
          heggink wrote: Thursday 09 October 2025 22:49 For those interested, I use the node red library to communicate with my Tado devices. Comms to domoticz is done by reading and posting mqtt msgs using autodiscovery (send discovery message, read/write topics).
          Happy to share if anyone is interested. I only have one thermostat but the basic principle is there.
          I am interested as well.

          Does it communicated directly with the devices or also via the API

          Re: Tado Thermostat plugin

          Posted: Friday 10 October 2025 15:35
          by heggink
          Since this is a generic MQTT-AD based comms (Gizmocuz did most of the heavy lifting for our home batteries), I will try to create a wiki page that explains the principles with the Tado example (and the associated flow). I am having some difficulties changing the wiki so will report back when done.

          Re: Tado Thermostat plugin

          Posted: Monday 20 October 2025 16:55
          by sloeber70
          Hi,

          I did setup a HA v16.2 stable VM on Proxmox and added the TADO plugin. I can monitor and control everything from HA.
          Created a dedicated MQTT LXC for testing
          HA sends the messages to MQTT LXC : no problems so far. Topics are updated normally. See MQTT explorer snapshot.
          But when trying to get results into Domoticz... nothing.. it fails... no errors in the log.

          2025-10-20 16:22:12.884 Status: MQTTLAN2: Connecting to 10.10.3.44:1883
          2025-10-20 16:22:13.085 Status: MQTTLAN2: Connected to: 10.10.3.44:1883

          New devices discovery is set on... no devices discovered...

          Did I miss something?

          Re: Tado Thermostat plugin

          Posted: Wednesday 22 October 2025 11:10
          by sloeber70
          HI,

          Could this be Domoticz MQTT-AD related?
          All topics are visible in MQTT Explorer but devices are not imported into DZ.
          I did setup a separate test environment on Proxmox VE:
          separate LXC MQTT broker
          separate VM domoticz - latest beta on Debian 13.

          The live environment is working fine on Proxmox....

          Re: Tado Thermostat plugin

          Posted: Wednesday 22 October 2025 14:28
          by jannl
          This still uses the TADO api?