Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read/Write-able attributes are not read #135

Closed
allofmex opened this issue Dec 31, 2018 · 7 comments
Closed

Read/Write-able attributes are not read #135

allofmex opened this issue Dec 31, 2018 · 7 comments
Labels

Comments

@allofmex
Copy link
Collaborator

Seems, toZigbee.js attributes from shepherd-converter are never read by ioBroker.zigbee.

I implemented #134, and it works for writing (type 'set'). The issue is that the value never gets read from device ('get').

It looks like it is not implemented yet:
(the "->>" lines should be changed as shown (key and error, resp arguments where missing))

          adapter.log.debug(`Read timeout for cmd '${message.cmd}' is ${readTimeout}`);
              setTimeout(()=>{
->>           const readMessage = converter.convert(key, preparedValue, preparedOptions, 'get');
                  if (readMessage) {
                      adapter.log.debug('read message: '+safeJsonStringify(readMessage));
                      // adapter.log.info(`3 before read publish. time: ${new Date() - start}`);
                      zbControl.publish(deviceId, readMessage.cid, readMessage.cmd, readMessage.zclData, ep, 
 ->>                          readMessage.cmdType, (error, resp)=>{
                          // adapter.log.info(`6 read publish success. ${stateDesc.id} time: ${new Date() - start}`);
                           ->> response ignored!  <<-
                      });
                      // adapter.log.info(`4 after read publish. time: ${new Date() - start}`);
                  }
              }, readTimeout || 0);

I tried to submit this as pull request, but git always shows the whole file as changed. Don't know why!?

Please implement the 'get' type too. Else we don't see current attribute value and if written values got accepted.

@arteck
Copy link
Collaborator

arteck commented Jan 1, 2019

it's already in mine PR
arteck@6b26ff6

@allofmex
Copy link
Collaborator Author

allofmex commented Jan 1, 2019

Thanks, I see the fixed stateKey arguments.
But the read result is still ignored right? (callback empty)
So the value is never published, the Object just shows the last entered value or nothing if we never wrote something!?

@arteck
Copy link
Collaborator

arteck commented Jan 2, 2019

But the read result is still ignored right? (callback empty)...

Yes you are right.. we send ON and the published state is also ON..
why should I read the state again ??

@allofmex
Copy link
Collaborator Author

allofmex commented Jan 2, 2019

  1. The write may have failed or we wrote a illegal value. As of now the wrong value keeps showing in object and we don't get any feedback.
  2. In case we never write anything, the Object should be read at least once to see current (default) setting

This is more needed for device settings that we not configure reporting for (timeouts,... Koenkk/zigbee-herdsman-converters#185), I guess it's not a good idea to add fromZigbee and reporting for all this rarely changed attributes...

@modmax
Copy link
Collaborator

modmax commented Jan 31, 2019

I think this issue can be closed now.
With the definition of readAfterWriteStates this should be possible.

@allofmex
Copy link
Collaborator Author

allofmex commented Feb 1, 2019

Just one point: Would be nice to read all readAfterWrite states once after adapter start. Then we also see the device setting if we did not write anything. (maybe earliest 2 minutes after adapter start to limit the load right at startup. And right after device send something to be sure it is not sleeping)

@stale
Copy link

stale bot commented Apr 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 2, 2019
@allofmex allofmex closed this as completed Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants