Page 1 of 1

The error of object could not be found.

Posted: Sat Jan 04, 2025 7:03 am
by Simon
Dear Currysmarter team,
I recently bought the Tasmota roller shutter switch from you and successfully integrated it into Home Assistant. I use this configuration in my YAML file:

mqtt:
cover:
- name: "Emanuel Rollladen"

unique_id: "emanuel_rollladen"
qos: 1
command_topic: "cmnd/tasmota_emanuel_rollladen/tuyasend4"
payload_open: "1,0"
payload_close: "1,2"
payload_stop: "1,1"
set_position_topic: "cmnd/tasmota_emanuel_rollladen/shutterposition"
set_position_template: "{{value}}"
position_topic: "stat/tasmota_emanuel_rollladen/RESULT"
position_template: "{{ value_json.Shutter1.Position }}"
availability_topic: "tele/tasmota_emanuel_rollladen/LWT"
payload_available: "Online"
payload_not_available: "Offline"

Unfortunately, I get the following errors in my logs, even though the roller shutter is actually working. What could be the reason for this?

Logger: homeassistant.components.mqtt.cover
Source: components/mqtt/cover.py:431
Integration: MQTT (documentation, issues)
First encountered: 11:42:32 (3406 occurrences)
Last logged: 12:21:14

Template (position_template) returned JSON without position attribute

Logger: homeassistant.helpers.template
Source: helpers/template.py:809
First encountered: 11:42:32 (3406 occurrences)
Last logged: 12:21:14

Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":186,"Free":325,"Rules":"ON Shutter1#Target DO if(%value%$!%Var1%) Var1 %value% endif ENDON ON Var1#state DO backlog TuyaSend2 2,%Var1% ENDON ON Power1#state=1 DO rule2 0 ENDON ON Power1#state=0 DO rule2 1 ENDON"}}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"Var1":"100"}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"TuyaSend":"Done"}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"Var4":"100"}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"If":"Done"}, template: {{ value_json.Shutter1.Position }})

Logger: homeassistant.helpers.template
Source: helpers/template.py:2740
First Occurred: 11:42:32 (3800 occurrences)
Last logged: 12:21:14

Template variable error: 'dict object' has no attribute 'Shutter1' when rendering '{{ value_json.Shutter1.Position }}'
Template variable warning: 'dict object' has no attribute 'Var4' when rendering '{{ value_json.Var4 }}'
Template variable warning: 'dict object' has no attribute 'SHUTTER1' when rendering '{{ value_json.SHUTTER1 }}'

Thank you for your help.

-------------

Hello,
Here is the output from the console:
17:08:50.848 RUL: TUYARECEIVED#DPTYPE2ID2 performs "Var4 100"
17:08:50.853 MQT: stat/tasmota_emanuel_rollladen/RESULT = {"Var4":"100"}
17:08:50.897 CMD: Status 0
17:08:50.902 MQT: stat/tasmota_emanuel_rollladen/STATUS = {"Status":{"Module":0,"DeviceName":"Shutter","FriendlyName":["Shutter"],"Topic":"tasmota_emanuel_rollladen","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState" :1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetai n":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}}
17:08:50.957 MQT: stat/tasmota_emanuel_rollladen/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"firmware/EU-CL02_esp32c3.bin","RestartReason":"Software reset digital core","Uptime":"5T03:49:54","StartupUTC":"2024-12-25T12:18:56","Sleep":50,"CfgHolder":4617,"BootCount":195,"BCResetTime":"2024-12-25T12:58:17","SaveCount":661}}
17:08:51.008 MQT: stat/tasmota_emanuel_rollladen/STATUS2 = {"StatusFWR":{"Version":"13.0.0(Shutter)","BuildDateTime":"2024-05-30T07:41:13","Core":"2_0_10","SDK":"4.4.5.230614","CpuFrequency":160,"Hardware":"ESP32-C3 rev.4","CR":"472/699"}}
17:08:51.037 MQT: stat/tasmota_emanuel_rollladen/STATUS3 = ​​{"StatusLOG":{"SerialLog":2,"WebLog":2,"MqttLog":0,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["At Bergers","T-test"],"TelePeriod":30,"Resolution":"558180C0","SetOption":["0000A009","0405C80001000600003C5A0A192800000000","40000080","00006000","00004000","00000000"]}}
17:08:51.083 MQT: stat/tasmota_emanuel_rollladen/STATUS4 = {"StatusMEM":{"ProgramSize":1876,"Free":1003,"Heap":184,"StackLowMark":3,"PsrMax":0,"PsrFree":0,"ProgramFlashSize":4096,"FlashSize":4096,"FlashChipId":"164020","FlashFre quency":80,"FlashMode":"DIO","Features":["00000809","9F9A17DF","0011A001","B7F7BFCF", "05DA9BC0","E0360D47","080840D2","20200000","84BC482D","000A80B1"],"Drivers":"1,2,3,4 ,5,7,8,9,10,11,12,14,16,17,20,21,24,27,29,34,35,38,50,52,59,60,62,63,66,67,68,86,87, 88","Sensors":"1,2,3,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20,21,22,26,31,34,37,39,40, 42,43,45,51,52,55,56,58,59,64,66,67,74,85,92,95,98,103,105,127","I2CDriver":"7,8,9,10,11,12,13,14,15,17,18,20,24,29,31,36,41,42,44,46,48,58,62,65,69,76,77"}}
17:08:51.171 MQT: stat/tasmota_emanuel_rollladen/STATUS5 = {"StatusNET":{"Hostname":"tasmota-emanuel-rollladen-5140","IPAddress":"10.10.10.119","Gat eway":"10.10.10.1","Subnetmask":"255.255.255.0","DNSServer1":"10.10.10.1","DNSServer2":"0. 0.0.0","Mac":"54:32:04:84:34:14","IP6Global":"fd54:491d:9181::5632:4ff:fe84:3414","IP6Loca l":"fe80::5632:4ff:fe84:3414","Webserver":2,"HTTP_API":1,"WifiConfig":2,"WifiPower":19.0}}
17:08:51.223 MQT: stat/tasmota_emanuel_rollladen/STATUS6 = {"StatusMQT":{"MqttHost":"10.10.10.4","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_843414","MqttUser":"mqttuser","MqttCount":1,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":4}}
17:08:51.263 MQT: stat/tasmota_emanuel_rollladen/STATUS7 = {"StatusTIM":{"UTC":"2024-12-30T16:08:51","Local":"2024-12-30T17:08:51","StartDST":"2024-03-31T0 2:00:00","EndDST":"2024-10-27T03:00:00","Timezone":"+01:00","Sunrise":"08:43","Sunset":"17:01"}}
17:08:51.305 MQT: stat/tasmota_emanuel_rollladen/STATUS10 = {"StatusSNS":{"Time":"2024-12-30T17:08:51","Shutter1":{"Position":100,"Direction":0,"Target":100,"Tilt":0}}}
17:08:51.334 MQT: stat/tasmota_emanuel_rollladen/STATUS11 = {"StatusSTS":{"Time":"2024-12-30T17:08:51","Uptime":"5T03:49:55","UptimeSec":445795,"Heap":182,"SleepMode":"Dynamic ","Sleep":50,"LoadAvg":19,"MqttCount":1,"Berry":{"HeapUsed":4,"Objects":46},"POWER":"OFF","Wifi":{"AP":1,"SSId":"At Bergers","BSSId":"0C:72:74:D8:4E:F1","Channel":1,"Mode":"11n","RSSI":100,"Signal":-50,"LinkCount":1,"Downtime":"0T00:00:04"}}}
17:08:51.386 MQT: stat/tasmota_emanuel_rollladen/STATUS13 = {"StatusSHT":{"SHT0":{"Relay1":1,"Relay2":2,"Open":100,"Close":100,"50perc":50,"Delay":0,"Opt":"0000","Calib":[300,500,700,900,1000],"Mode":"3"}}}
17:08:51.878 RUL: TUYARECEIVED#DPTYPE4ID1 performs "if (1$!1) Var6 1 endif"
17:08:51.882 MQT: stat/tasmota_emanuel_rollladen/RESULT = {"If":"Done"}
17:08:51.904 RUL: TUYARECEIVED#DPTYPE2ID2 performs "Var4 100"
Many thanks and best regards

Re: MQTT configuration in YAML file

Posted: Mon Jan 06, 2025 3:08 pm
by Lynn
You need to check the three rules we set by default. Please do not change them and make sure that they are at "ON" status.
they should be:

Code: Select all

15:36:16.216 CMD: rule1
15:36:16.221 MQT: stat/Rollladen_LI-Nord/RESULT = {"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":186,"Free":325,"Rules":"ON Shutter1#Target DO if(%value%$!%Var1%) Var1 %value% endif ENDON ON Var1#state DO backlog TuyaSend2 2,%Var1% ENDON ON Power1#state=1 DO rule2 0 ENDON ON Power1#state=0 DO rule2 1 ENDON"}}
15:36:20.694 CMD: rule2
15:36:20.705 MQT: stat/Rollladen_LI-Nord/RESULT = {"Rule2":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":511,"Free":0,"Rules":"ON Var6#state=1 DO if (Var4>Var3+2 or Var4<Var3-2) backlog rule1 0; Var16 McuSyn endif ENDON ON Time#Minute|2 DO if (Var4>Var3+2 or Var4<Var3-2) backlog rule1 0; Var16 McuSyn endif ENDON ON Var16#state=McuSyn DO ShutterPosition %Var4% ENDON ON Shutter1#Target DO if(%value%$!%Var1%) Var1 %value% endif ENDON ON Shutter1#Position Do Var3 %value% ENDON ON TuyaReceived#DpType2Id2 Do Var4 %value% ENDON ON TuyaReceived#DpType4Id1 DO  if (%value%$!%Var6%) Var6 %value% endif ENDON ON Power1#state=0 DO rule1 1 ENDON"}}
15:36:22.424 CMD: rule3
15:36:22.429 MQT: stat/Rollladen_LI-Nord/RESULT = {"Rule3":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":234,"Free":277,"Rules":"ON Wifi#Disconnected DO Restart 1 ENDON ON system#init DO Backlog rule1 1; rule2 1 ENDON ON Wifi#Connected DO Backlog TuyaSend1 7,0; TuyaSend1 7,1; TuyaSend1 7,0; TuyaSend1 7,1 ENDON ON Time#Minute|20 DO Backlog rule1 1; rule2 1 ENDON"}}
Sometimes the tasmota will disable rules to ensure it can boot correctly if it detects some abnormal situations when power on / restart. Thus, be sure that the three rules are at the "ON" state.
If the rules have been changed, please run following commands on your console to restore them.

Code: Select all

rule1 ON Shutter1#Target DO if(%value%$!%Var1%) Var1 %value% endif ENDON ON Var1#state DO backlog TuyaSend2 2,%Var1% ENDON ON Power1#state=1 DO rule2 0 ENDON ON Power1#state=0 DO rule2 1 ENDON

Code: Select all

rule2 ON Var6#state=1 DO if (Var4>Var3+2 or Var4<Var3-2) backlog rule1 0; Var16 McuSyn endif ENDON ON Time#Minute|2 DO if (Var4>Var3+2 or Var4<Var3-2) backlog rule1 0; Var16 McuSyn endif ENDON ON Var16#state=McuSyn DO ShutterPosition %Var4% ENDON ON Shutter1#Target DO if(%value%$!%Var1%) Var1 %value% endif ENDON ON Shutter1#Position Do Var3 %value% ENDON ON TuyaReceived#DpType2Id2 Do Var4 %value% ENDON ON TuyaReceived#DpType4Id1 DO  if (%value%$!%Var6%) Var6 %value% endif ENDON ON Power1#state=0 DO rule1 1 ENDON

Code: Select all

rule3 ON Wifi#Disconnected DO Restart 1 ENDON ON system#init DO Backlog rule1 1; rule2 1 ENDON ON Wifi#Connected DO Backlog TuyaSend1 7,0; TuyaSend1 7,1; TuyaSend1 7,0; TuyaSend1 7,1 ENDON ON Time#Minute|20 DO Backlog rule1 1; rule2 1 ENDON
 

Code: Select all

 backlog rule1 1; rule2 1; rule3 1
Now your problem is MQTT period, make sure that the name you set for the topic is exactly follow our instruction in the link below:
viewtopic.php?t=8&sid=c7ebe9725d0a1b10eefdaed4c0bb2c6e
If you don't upgrade the firmware by yourself, you can also easily reset it by command "reset 5", which will erase all flash and reset parameters to firmware defaults but keep Wi-Fi settings and restart.

Re: MQTT configuration in YAML file

Posted: Mon Jan 06, 2025 8:26 pm
by lontage
Hi,
Thanks for your quick reply. I've done these steps and the rules are all enabled and working. The Shutter from Homeassistant is also working fine. I've called the Shutter in The "Configure Other" Menu Shutter1, as called in the MQTT YAML entry in the homeassistant config.
But still, the shutter is getting these errors - I think, if the shutter is publishing something different than the {{ value_json.Shutter1.Position }}, this error is popping up. Is there a way to surpress it?
Yours,
Emanuel Berger

Code: Select all

Logger: homeassistant.components.mqtt.cover
Quelle: components/mqtt/cover.py:431
Integration: MQTT (Dokumentation, Probleme)
Erstmals aufgetreten: 5. Januar 2025 um 10:43:50 (216943 Vorkommnisse)
Zuletzt protokolliert: 21:26:11

Template (position_template) returned JSON without position attribute


Logger: homeassistant.helpers.template
Quelle: helpers/template.py:809
Erstmals aufgetreten: 5. Januar 2025 um 10:43:50 (216944 Vorkommnisse)
Zuletzt protokolliert: 21:26:11

Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":186,"Free":325,"Rules":"ON Shutter1#Target DO if(%value%$!%Var1%) Var1 %value% endif ENDON ON Var1#state DO backlog TuyaSend2 2,%Var1% ENDON ON Power1#state=1 DO rule2 0 ENDON ON Power1#state=0 DO rule2 1 ENDON"}}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"Var1":"100"}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"TuyaSend":"Done"}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"Var4":"100"}, template: {{ value_json.Shutter1.Position }})
Error parsing value: 'dict object' has no attribute 'Shutter1' (value: {"If":"Done"}, template: {{ value_json.Shutter1.Position }})


Logger: homeassistant.helpers.template
Quelle: helpers/template.py:2740
Erstmals aufgetreten: 5. Januar 2025 um 10:43:50 (216944 Vorkommnisse)
Zuletzt protokolliert: 21:26:11

Template variable error: 'dict object' has no attribute 'Shutter1' when rendering '{{ value_json.Shutter1.Position }}'
Template variable error: 'value_json' is undefined when rendering '{{ value_json.Shutter1.Position }}'

Re: MQTT configuration in YAML file

Posted: Tue Jan 07, 2025 3:43 am
by Lynn
You are welcome.
I finally find out the same error log in my HA.
Reason: the position_topic: "stat/Rollladen_LI-Nord/RESULT" we used is a common reply. By default, Tasmota replies to all commands through .../RESULT. But lots of them are not related to our position result. Thus, HA will have error log when it cannot find a proper object according to our template.
Here is the solution:

1. on tasmota webUI

Code: Select all

setoption4 1
2. on the yaml file, change the position_topic, "RESULT" into "SHUTTER"

Code: Select all

position_topic: "stat/Rollladen_LI-Nord/SHUTTER"
3. on HA, settings-system-logs, clear the error log.
Then, you will not see any of these errors again. I will update our instructions if this also work well for your case.

Re: The error of object could not be found.

Posted: Tue Jan 07, 2025 3:28 pm
by lontage
Thank you very much for your help!! That makes a lot of sense, and now the problem is fixed and I receive no error messages again.
The position control also works from Home Assistant.
Yours,
Emanuel