opensmarthouse / opensmarthouse-web

Provides public elements of OpenSmartHouse web site including ZWave database import/export and log file processors.
0 stars 2 forks source link

Decimals in the firmware versions do not always display properly #30

Open 5iver opened 3 years ago

5iver commented 3 years ago

The newest version of the firmware for the ZEN16 is 1.03.

image

I entered the lower bound as 1.01 and upper as 1.03. This displays as 1.10-1.30.

image

image

cdjackson commented 3 years ago

Try entering the numbers as 1.1 and 1.3 (or 1.001 and 1.003). In theory it shouldn't matter - the two sides of the decimal should be treated separately, so 1.1 should be the same as 1.01 or 1.001, but maybe there's an issue with the way this conversion is done as we'd normally present this as 1.003 or 1.3

5iver commented 3 years ago

Hmmm. I have not yet updated the firmware and I'm relying on Zooz and the documentation for the version number. I'll get it updated and see what version it actually shows up as.

cdjackson commented 3 years ago

In ZWave, as many other versioning systems, the two numbers are treated as a minor and major version and not as a single decimal value.

5iver commented 3 years ago

I updated the firmware. The device was not recognized, so I updated the database entry again. I entered the min as 1.001 and max as 1.003 and it is displayed as...

image

.. and...

image

Entering as 1.1 and 1.3, or 1.100 and 1.300, resulted in an error...

image

This is not intuitive. If anything, we should have a note that the minor version must be entered as a three digit number. It seems the number is being padded from the right (3 becomes 300), so maybe this could be changed to pad from the left (3 becomes 003). Either way, the display seems to be removing all of the zeros to the left (1.030 shows as 1.30, see above).

Feature request for the future... there also seems to be no way to cancel changes. I just went in to get the screenshots and had to approve the changes rather than remove them.

Best wishes in the new year!

cdjackson commented 3 years ago

Clearly this is a bug so we shouldn't document this (IMHO). I will try and take a look at it.

FTR - 1.3 should be the same as 1.003, and different from 1.030 (which is the same as 1.30 - major rev 1, and minor rev 30).

Regarding cancelling changes - this would be a major change to the database to find some way to revert any changes that had been made across the dozen or so tables that make up a devices definition. I do agree - this would really be super helpful, but I'm not sure that it's worth it for the few times it's needed as it would really be a lot of work I think.

bwosborne2 commented 3 years ago

Happy New Year and welcome to independence, Chris 🤣 I see it was complaining about the 300 after the decimal IIRC, the field goes from 0 to 255. I am quite interested in helping out on the website to help relieve the load on Chis.

cdjackson commented 3 years ago

Happy New Year

Thanks - and to you all as well.

welcome to independence

Yeah - well, don't get me started on that ;)

I see it was complaining about the 300 after the decimal IIRC, the field goes from 0 to 255.

Yes, version numbers are 1 byte - so 0 to 255, or 0.0 to 255.255. Sometimes you might see 255.255 written somewhere as this is used internally and gets converted to max.

I am quite interested in helping out on the website to help relieve the load on Chis.

I did set your account back up, but probably didn't send you the password. In theory, I believe that you should have got an email from the system (since I ticked a box to initialise by email - or something like that) but I guess you didn't receive it? I forget when I did that - sometime in the past week.

bwosborne2 commented 3 years ago

I never got the email but, IIRC that was just for the database access, correct? I do not have any sort of guide to the website management or Wappler. I have worked with HTML5 & CSS including SASS (better structured CSS that compiles to down CSS) and am working through Javascript now.

bwosborne2 commented 3 years ago

At least this did not happen. image

cdjackson commented 3 years ago

No - it's not just the database access - it's the complete website. It is possible to edit stuff there without Wappler (that is what I am also doing). If we have multiple people doing that though, we will just need to be careful.

More complex parts may be difficult to edit without Wappler, and Wappler definitely makes things easier, but most stuff is possible without it (unless we wanted to make major changes, or add a new page etc - that could be done, but really would be best to use the editor).

bwosborne2 commented 3 years ago

OK, I will wait for the email. If you wish, I can send you my old password.

I will just need to wrap my head around the directory structure. Do you edit in the browser or is there something like git access?

cdjackson commented 3 years ago

I guess the mail won’t come now if it hasn’t in the past week :)

I will take a look later and see if there’s an option to resent, otherwise I’ll set a password and send you a mail.

cdjackson commented 3 years ago

Please let me know if this is now working as you expect.

5iver commented 3 years ago

Getting there!

While on the subject of firmware versions, as a noob looking in, it is not clear whether the min and max are inclusive.

image

Currently, 1.0-1.3 means that the firmware is >1.0 and <=1.3. At least, that is how I understand it! When I see 1.0-1.3, I take it to mean that 1.0 is also included. Using set notation, a left-open and right-closed interval might be more descriptive, (1.0, 1.3], but you may need to be familiar with set theory.

bwosborne2 commented 3 years ago

Similarly the list versions need adjusting. The example below should be <= 1.0, <= 1.3, 1.0 - 1.3, >= 1.4

image

EDIT Perhaps instead of 1.0 - 1.3 we should have >= 1.0 & <= 1.3or1.0 - 1.3 inclusive`