update temp+humidity+battery

Moderator: leecollings

Post Reply
xavierlp
Posts: 70
Joined: Tuesday 01 November 2016 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: France
Contact:

update temp+humidity+battery

Post by xavierlp »

Hello all

I would like to update a dummy device (Temp+hum)

I could find with the wiki this code and it is ok

Code: Select all

local function update(idx, value1, value2)
        local cmd = string.format("%d|0|%.2f;%.2f", idx, value1, value2) .. ';0' 
        table.insert (commandArray, { ['UpdateDevice'] = cmd } )
 end
 
Now, I would like to add the batterylevel of this device.
But I can't find the way or syntaxe in "UpdateDevice"

Is it possible ?

Thanks a lot
User avatar
psubiaco
Posts: 222
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: update temp+humidity+battery

Post by psubiaco »

Did you try as I answered to you in the French forum?
It works for me: I can update devices, both temperature and humidity, in that way.

Code: Select all

tempdevice = indoor_device_idx..'|0|'..intemperature..';'..inhumidity..';0'
commandArray[1]={['UpdateDevice'] = tempdevice }

return commandArray
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
xavierlp
Posts: 70
Joined: Tuesday 01 November 2016 16:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: France
Contact:

Re: update temp+humidity+battery

Post by xavierlp »

Thank you

Yes I can do it for temp + humidity

But I can’t find the way to add batterylevel

Any clues ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest