crycode-de / ioBroker.ds18b20

ioBroker adapter for DS18B20 1-wire temperature sensors
MIT License
6 stars 8 forks source link

Wish: Order of the Devices OR Allow using a defined busmaster. #95

Closed pos-ei-don closed 2 years ago

pos-ei-don commented 2 years ago

I have 16 Busmasters busmasters.

Unfortunately the order of the 1w-Devices in the List gets resorted sometimes. I could not see the sortorder. I need to group Temp_Sensors, whoch belongs to a special busmaster.

Is sorting or keeping the current sortorder in the list possible?

If not, is it somehow possible to query just one busmaster in one instance of this adapter? When I trie to enter /sys/bus/w1/devices/w1_bus_master2, it does not show my any results.

thank you alot for this great adapter!

 ls /sys/bus/w1/devices/w1_bus_master2/ -l
total 0
drwxr-xr-x 4 root root    0 Jan 19 07:36 28-000004d103f4
drwxr-xr-x 4 root root    0 Jan 19 07:36 28-021689ca94ff
drwxr-xr-x 4 root root    0 Jan 19 07:36 28-021689ecd9ff
drwxr-xr-x 4 root root    0 Jan 19 07:36 28-02168a24c1ff
drwxr-xr-x 4 root root    0 Jan 19 07:36 28-02168a24e5ff
drwxr-xr-x 4 root root    0 Jan 19 07:36 28-02168a2a64ff

I'd like to be able to query one special Busmaster in an instance. This would help

crycode-de commented 2 years ago

The sensors in the admin interface will be sort by device address on each load. This is because the admin interface simply reads the objects in ds18b20.x.sensors.* and lists the configured sensors in this order. So currently it's not possible to change the order here.

Also it's currently not possible to search for devices on one bus master only. The adapter internally detects all bus masters and reads the slaves on them.

What you can do is to use an own adapter instance for each bus master and add the sensors manually (by entering the addresses) in the instance configuration.

~~An other (somewhat ugly) idea/workaround: You may add a dir called w1_bus_master2 in /sys/bus/w1/devices/w1_bus_master2/ and there a symlink from w1_master_slaves to ../w1_master_slaves. So /sys/bus/w1/devices/w1_bus_master2/w1_bus_master2/w1_master_slaves links to /sys/bus/w1/devices/w1_bus_master2/w1_master_slaves. Then you should be able to set /sys/bus/w1/devices/w1_bus_master2/ as "Path of the 1-wire devices" in the instance config.~~

I'll check if I can add some device grouping, filtering or something similar. Maybe optionally group the sensors by bus master? But this may take some time...

crycode-de commented 2 years ago

Just released v1.6.0 on NPM, should be tomorrow in the latest repo.

This release adds sorting (and keep the manual sort order) of the sensor in the admin ui. Also it adds the possibility to set a 1-wire bus master (e.g. /sys/bus/w1/devices/w1_bus_master2) as Path of the 1-wire devices. Using this you can easily configure one adapter instance for each bus master.

@pos-ei-don Please let me know if this solves this issue for you. 🙂

pos-ei-don commented 2 years ago

wow, wow.... will test it soon, after some days on vacation. thanks a lot!!

pos-ei-don commented 2 years ago

@crycode-de This is a really great enhancement! Thank you! I just added 11 different Busmaster-Devices and it seems that I even can read them faster now!

pos-ei-don commented 2 years ago

The individual scanning of the busmasters has very pleasant side effects for me! In between I had timeouts on individual sensors again and again, which confused my watchdogs and sometimes led to false alarms. Since the update, I could no longer observe timeouts. This is probably because the different instances of the adapter (one instance per bus master) have their own timings.

Very great update!!!!

crycode-de commented 2 years ago

Thank you for the feedback! I'm glad to read this. Also nice to know, that this could solve some issues. :)