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

Support other relays and update status #3

Merged
merged 1 commit into from Sep 24, 2020
Merged

Support other relays and update status #3

merged 1 commit into from Sep 24, 2020

Conversation

smoothquark
Copy link
Contributor

Hi gertst. This is my first ever pull request (!). As you know, I reported two issues...

  1. Channels apart from Channel 1 were not being recognised for status and pushbutton events. We established that the original code was based on the VMB4RY relay. The protocols seem to be different for other relays. So, I have added in some code to check which relay it is. I have not looked at all the possible relays though as I am still very new to Velbus. I have added in the comments the relay protocols I have looked at.

  2. Status was not always updated after a push button event, even with No.1 above. I have therefore moved the status update to the updateStatus function, and both the 'onSerialPacket' and 'input' events call this function to update.

Not sure if this is the correct way to do things. I think Velbus always sends a FA packet and the relay units respond with a FB packet. The velbus-relay.js does send an FA packet via the requestStatus() on deploy, but calling this after the input event only works occasionally, so this code is a bit of a workaround. I think there must be a better, more robust way, but I don't know enough of the Velbus protocols yet.

…r relay modules apart from VMB4RY and to update status after toggle/on/off
@gertst gertst marked this pull request as draft September 24, 2020 07:30
@gertst gertst self-assigned this Sep 24, 2020
@gertst gertst marked this pull request as ready for review September 24, 2020 08:52
@gertst gertst merged commit eff3416 into gertst:master Sep 24, 2020
@gertst
Copy link
Owner

gertst commented Sep 24, 2020

I'm testing the merge as we speak and will update to npm / node-red later today.
I had some other updates waiting for merging to the master branch, so I will merge all together into a new build.
Thanks for your contribution!

@smoothquark
Copy link
Contributor Author

smoothquark commented Sep 24, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants