Lux update to Wave Sensor

Posted on
Sun Oct 07, 2018 12:43 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Lux update to Wave Sensor

Peter,

Just used this plugin to read and put the Temp into a variable from the updated Neo Motion Detection, Light intensity and Temperature Sensor but I cannot get to the Lux value, is it possible to add Lux to your plugin?

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sun Oct 07, 2018 1:56 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Lux update to Wave Sensor

Probably...

It won't be soon but I'll certainly add to the list.

Peter

Posted on
Sun Oct 07, 2018 2:07 pm
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Lux update to Wave Sensor

howartp wrote:
Probably...

It won't be soon but I'll certainly add to the list.

Peter


Thats fine, perhaps also add motion on/off and you have a plugin for all new motion/temp/Lux sensors coming to the market!!!

Not sure if that is doable?

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sat Dec 15, 2018 5:13 am
CliveS offline
Posts: 770
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

I blame Global Warming!

I know that this was originally written to sort out the multi power strip plugs and you added Temp and Humidity as an extra.

Well I added Contact, Lux, Motion, Battery, Leak sensors to your existing Power, Temp and Humidity plugin and everything was fine until last night when it went below 0c

Z-Wave Watcher Debug Raw command received (Node 207): 01 0C 00 04 00 CF 06 31 05 01 22 FF F0 26
Z-Wave Watcher Debug Node ID 207 (Hex 207) found in watchIDs
Z-Wave Sensor Logger Debug Bitmask: 0b100010, DP: 1, Scale: 0, ByteLength: 2
Z-Wave Sensor Logger Debug Temperature Reported (Node 207 Endpoint None): 6552.0 celsius <<<<<<< I blame Global Warming!!!
Error XML Parse Error: not well-formed (invalid token)
Error On character 457 of line number 1


So I have been playing around and come up with
Code: Select all

degreeC      = u"\u00b0C"              <<<<<<<<< Added
degreeF      = u"\u00b0F"              <<<<<<<<<

#
#
            if (bmlen == 1):
               value = int(bytes[11],16)
            elif (bmlen == 2):
               value = int(bytes[11] + bytes[12],16)
            elif (bmlen == 4):
               value = int(bytes[11] + bytes[12] + bytes[13] + bytes[14],16)

            value = float(value) / (10**bmdp) # Divide by 10^2 (100) or 10^3 (1000) etc

            if value > 6500:                               <<<<<<<<< Added
               value = float((6554-value)*-1)             <<<<<<<<<

            if (bmsc == 0): # celsius            
               uivalue = str(value) + degreeC           <<<<<<<<< Changed to stop error
               self.debugLog(u"Temperature Reported (Node " + str(int(bytes[5],16)) + " Endpoint " + str(endpoint) + "): " + str(value) + " celsius")



And now get
Z-Wave Watcher Debug Raw command received (Node 207): 01 0C 00 04 00 CF 06 31 05 01 22 FF F6 20
Z-Wave Watcher Debug Node ID 207 (Hex 207) found in watchIDs
Z-Wave Sensor Logger Debug Bitmask: 0b100010, DP: 1, Scale: 0, ByteLength: 2
Z-Wave Sensor Logger Debug Temperature Reported (Node 207 Endpoint None): -1.4 celsius

Peter, Thanks for a great plugin that I have modified (can't write plugin's myself) to cover sensors that are not supported at present and I have learnt a lot about Python from modifying your code, still a long way to go but it has been fun (and frustrating)

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest