@bertreb
The error message is the same as shown in the picture. Every time the tasmota software sends a position change, an error message is displayed.
error [pimatic-mqtt]: value: NaN is out of range
Tasmota Console
wifi shutter device with mqtt and tasmota
@bertreb
The error message is the same as shown in the picture. Every time the tasmota software sends a position change, an error message is displayed.
error [pimatic-mqtt]: value: NaN is out of range
Tasmota Console
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
No 100. But I just tried 99. The same error message appears.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
@bertreb I changed the value to 101. Then to 102, then to 105. Then again to 110.
No improvement, always this error.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
The error message suggests that Shutter1.Position is not a number or doesn’t exist
Can you change the StateValueKey to ‘position’ or ‘Position’ or ‘ShutterPosition’ and see which one is working.
If you want to be sure what the StateValueKey should be, you need to look into the json coming from the shutter device.
For that you need a mqtt-tool like MQTTfx and subscribe to the state topic
@bertreb
Here is the output of the shutter device after it has switched.
It is the same output as in the console of the tasmota device.
$ mosquitto_sub -v -h 192.168.178.31 -p 1883 -t 'stat/shutter1/+'
stat/shutter1/RESULT {"POWER2":"ON"}
stat/shutter1/POWER2 ON
stat/shutter1/RESULT {"Shutter1":{"Position":100,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":95,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":85,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":75,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":65,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":55,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":45,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":35,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":25,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":15,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"Shutter1":{"Position":5,"Direction":-1,"Target":0}}
stat/shutter1/RESULT {"POWER2":"OFF"}
stat/shutter1/POWER2 OFF
stat/shutter1/SHUTTER1 0
stat/shutter1/RESULT {"Shutter1":{"Position":0,"Direction":0,"Target":0}}
stat/shutter1/RESULT {"POWER1":"ON"}
stat/shutter1/POWER1 ON
stat/shutter1/RESULT {"Shutter1":{"Position":0,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":7,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":17,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":27,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":37,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":47,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":57,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":67,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":77,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":87,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"Shutter1":{"Position":97,"Direction":1,"Target":100}}
stat/shutter1/RESULT {"POWER1":"OFF"}
stat/shutter1/POWER1 OFF
stat/shutter1/SHUTTER1 100
stat/shutter1/RESULT {"Shutter1":{"Position":100,"Direction":0,"Target":100}}
I have changed the StateValueKey to various specifications. Unfortunately all without success.
With mqtt-sensor I have the possibility to specify an “Attributes of device”. I have made two screenshots of it. This works very well.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)
StateTopic -> stat/shutter1/RESULT and StateValueKey -> Shutter1.Position seems the right values (like in your first screen shot)
To debug what mqtt is receiving as state info, you can add a line of code in pimatic-mqtt/devices/mqtt-dimmer.coffee and replace line 44
for key, data of flatten(data)
with
for key, data of flatten(data)
env.logger.debug "Key: " + key + ", data: " + JSON.stringify(data,null,2)
On every received mqtt message to will see in the debug the key and data value
I have added the line to this file. After a restart the error is gone.
In debug is not shown to me in relation to the shutter device.
But as I said, the constant error would be the shutter drives is gone.
Thank you very much for your help.
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." 09-28-2003, LINUS TORVALDS (http://www.nytimes.com)