Closed jack-blackson closed 2 years ago
I just checked the code. State is created as string. Would it be possible, that state were created by an older version of adapter? Try to delete state and restart adapter. Is problem solved or still there?
Hey! I just gave it a try, deleted all objects, restarted the instance of the adapter, and unfortunately still get a ton of error messages:
I think you're still using 0.4.0. Please update to 0.4.1 on git and test again. Therefore activate expert mode (the head symbol in the upper bar) and chosse the cat icon in adapter section. In the popup dialog select tab "from git" and type yahama. Adapter should be presented as one options. Select it and hit "install".
You are right. I ran the update to 0.4.1, just one info error when starting the adapter, and the volume one when changing volume:
Ok, I'll hve to check. Please give me some days ...
Can you check definition of state yamaha.0.Realtime.MAIN.VOL.
Here I see the following:
{ "type": "state", "common": { "name": "VOL", "type": "string", "role": "state" }, "native": {}, "_id": "yamaha.0.Realtime.MAIN.VOL", "from": "system.adapter.yamaha.0", "user": "system.user.admin", "ts": 1645102109067, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }
You'll find this in objects panel when clicking at the pencil at the right side of the state.
Looks for me like that: { "type": "state", "common": { "name": "VOL", "type": "number", "role": "state" }, "native": {}, "_id": "yamaha.0.Realtime.MAIN.VOL", "from": "system.adapter.yamaha.0", "user": "system.user.admin", "ts": 1646685879012, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }
Sorry, to ask again: you're sure that you deleted the whole state, not only the value of the state?
I don't know why, but I deleted the whole 0 folder, and now no error for the volume any more, and it is now also a string, like yours. Just the error for Pure Direct is left.
info | State value to set for "yamaha.0.pureDirect" has to be type "boolean" but received type "string"
{ "_id": "yamaha.0.pureDirect", "type": "state", "common": { "name": "pureDirect", "type": "boolean", "role": "state", "read": true, "write": true, "def": false, "desc": "Pure Direct" }, "native": {}, "from": "system.adapter.yamaha.0", "user": "system.user.admin", "ts": 1646853703480, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }
It seems that indeed, pureDirect will be set to "On" and "Off" and not true and false. Therefore I changed definition of state. Please delete state pureDirect and update to latest version in git.
I did the update, deleted all states, restarted the instance, and no error messages any more - good job, thanks for your work!!
You're welcome
Meanwhile I have updated to the latest Version (0.5.1) to solve the mentioned issue. But also after deleting states and later a complete reinstall of the adapter, the type is always set as "number". What am I doing wrong? Any hints?
Please show a screenshot of the state and of the settings (pencil icon)
{ "type": "state", "common": { "name": "VOL", "type": "number", "role": "state" }, "native": {}, "_id": "yamaha.0.Realtime.MAIN.VOL", "from": "system.adapter.yamaha.0", "user": "system.user.admin", "ts": 1649000043080, "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }
What are the values stored in this state? Numbers or strings? Do you get warning messages about wrong types like the original poster?
yes, it's the same massage:
State value to set for "yamaha.0.Realtime.MAIN.VOL" has to be type "number" but received type "string"
That's why I can't explain it and asked. After installing the adapter, the state does not yet exist. Only after using functions - e.g. the volume buttons on the remote control - the state is (wrong) created again.
Maybe I found a workaround: I manually changed the state type of xxx.MAIN.VOL to "string". After that, the message was gone. (Let's see how long) In this context, however, I have noticed three "new" similar messages:
State value to set for "yamaha.0.Realtime.NETRADIO.CURRLINE" has to be type "number" but received type "string" State value to set for "yamaha.0.Realtime.NETRADIO.MAXLINE" has to be type "number" but received type "string" State value to set for "yamaha.0.Realtime.NETRADIO.LISTLAYER" has to be type "number" but received type "string"
Me again: I am now afraid that I have only switched or postponed the problem: After changing the type in the adapter state to string, the javascript-adapter complained: javascript.0: State value to set for "yamaha.0.Realtime.MAIN.VOL" has to be type "string" but received type "number"
So I adjusted my scripts value.toString()
, then the message was gone there.
After that, I controlled the volume via my VIS widgts and the web-adapter complained: web.0: State value to set for "yamaha.0.Realtime.MAIN.VOL" has to be type "string" but received type "number"
But I can't adjust there. In the widget it must be "number".
So I wonder, why does the yamaha-adaper even expect a string as a volume-value instead of a number as would be expected for such a kind of value?
Reopen because? Please post new logs and such ith a current version
Reopen because he said, that thre are still messages about wrong type. I closed it after the first fix, but then additional issues were found. So I opened it again.
I would love to get a new issue with a current version and a new log :-)) because else we mix toooo much together
When changing the volume, I receive these messages in the debug log:
Versions: