DheerajKhajuria / pimatic-mysensors

mysensors
http://forum.mysensors.org/topic/797/pimatic-mysensors-controller-plugin
GNU General Public License v2.0
23 stars 24 forks source link

name for battery sensors #18

Closed sweebee closed 9 years ago

sweebee commented 9 years ago

I'm using some pirs with battery sensors and i read them with the battery device. But all i can see is battery_1, battery_2, battery_3 etc.. but I forget which is which sensor. Would be nice to give a name to the battery sensor.

sweebee commented 9 years ago

I'm now using the pimatic variables device, works great but would be better if its directly integrated in this plugin :)

DheerajKhajuria commented 9 years ago

sure can do it.. give me some time.

sweebee commented 9 years ago

Any update on this?

DheerajKhajuria commented 9 years ago

issue fixed.. hope it will work perfectly.. image

sweebee commented 9 years ago

Thank you very much! Lets see :D

sweebee commented 9 years ago

Tested it but it doesn't update the battery level if a sensor sends it?

sweebee commented 9 years ago

I think this is wrong?

@board.on("rfbattery", (result) =>
        unless result.value is null or undefined
          @_batterystat[result.sender] =  parseInt(result.value)
          @emit "battery_" + result.sender, @_batterystat[result.sender]
      )

This @emit "battery_" + result.sender, @_batterystat[result.sender] is wrong. Should find the name if the node id first.

DheerajKhajuria commented 9 years ago

yes this code is wrong and i fixed it..

On Tue, Jun 9, 2015 at 9:52 PM, Wiebe Nieuwenhuis notifications@github.com wrote:

I think this is wrong?

@board.on("rfbattery", (result) => unless result.value is null or undefined @batterystat[result.sender] = parseInt(result.value) @emit "battery" + result.sender, @_batterystat[result.sender] )

— Reply to this email directly or view it on GitHub https://github.com/DheerajKhajuria/pimatic-mysensors/issues/18#issuecomment-110421347 .

DheerajKhajuria commented 9 years ago

[image: Inline image 1] now the value is getting update..

On Tue, Jun 9, 2015 at 11:03 PM, Dheeraj dheeraj.khajuria@gmail.com wrote:

yes this code is wrong and i fixed it..

On Tue, Jun 9, 2015 at 9:52 PM, Wiebe Nieuwenhuis < notifications@github.com> wrote:

I think this is wrong?

@board.on("rfbattery", (result) => unless result.value is null or undefined @batterystat[result.sender] = parseInt(result.value) @emit "battery" + result.sender, @_batterystat[result.sender] )

— Reply to this email directly or view it on GitHub https://github.com/DheerajKhajuria/pimatic-mysensors/issues/18#issuecomment-110421347 .

sweebee commented 9 years ago

Works great so far 👍

n3roGit commented 9 years ago

can you please add custom names :)