update dummy device Baromater

Moderator: leecollings

Post Reply
User avatar
knasson
Posts: 17
Joined: Sunday 02 May 2021 22:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024-4
Location: France
Contact:

update dummy device Baromater

Post by knasson »

hi,
I created a dummy devic to manage the barometer pressure supplied by visual crossing.
why a got this? however the pressure appears in the device but not in the widget nor the icon.
baro.jpg
baro.jpg (42.47 KiB) Viewed 59 times
Attachments
widgetBaro.jpg
widgetBaro.jpg (15.02 KiB) Viewed 59 times
User avatar
jvdz
Posts: 2441
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: update dummy device Baromater

Post by jvdz »

How do you feed the data to the dummy barometer and what are the nvalue & svalue you supply?
User avatar
knasson
Posts: 17
Joined: Sunday 02 May 2021 22:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024-4
Location: France
Contact:

Re: update dummy device Baromater

Post by knasson »

the nvalue and svalue are coming from a script.

Code: Select all

json = (loadfile "/home/kan/domoticz/scripts/lua/JSON.lua")()  -- For Linux
commandArray = {}
local config=assert(io.popen("curl -s 'http://127.0.0.1:8080/json.htm?type=command&param=getdevices&rid=1306'"))
local blocjson = config:read('*all')
config:close()
local jsonValeur = json:decode(blocjson)
Baro = jsonValeur.result[1].Barometer
commandArray ['UpdateDevice']= '1511|0|'..Baro
return commandArray
the device 1306 is a THB of viSual crossing wihich supply Temp, Hygrometry and Barometer.
the pressure is extracted correctly by the script but the display of the widget is not completed.
User avatar
jvdz
Posts: 2441
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: update dummy device Baromater

Post by jvdz »

This is what is expected for nValue & sValue: https://wiki.domoticz.com/Domoticz_API/ ... #Barometer

So maybe it helps when you change the sValue to: BAR;BAR_FOR
Just as a test you could fix the forcast to 0=stable:

Code: Select all

commandArray ['UpdateDevice']= '1511|0|'..Baro..";0"
User avatar
knasson
Posts: 17
Joined: Sunday 02 May 2021 22:53
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024-4
Location: France
Contact:

Re: update dummy device Baromater

Post by knasson »

Excellent the right syntax that works for me is what you propose but with simple strokes

Code: Select all

commandArray ['UpdateDevice']= '1511|0|'..Baro..';0'
i had seen the svalue needs 2 values like you say but i ignored the right syntax
Many thanks
for our pleasure
RightBaro.jpg
RightBaro.jpg (16.98 KiB) Viewed 46 times
User avatar
waltervl
Posts: 6677
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: update dummy device Baromater

Post by waltervl »

Perhaps a stupid remark from me but as you use Visual Crossing data to have weather data in Domoticz like me: I have a Barometer automatically created by Domoticz based on the temp/hun/baro data from visual Crossing in the weather tab. Did you not have that?

I do not need to put barometer values in a separate dummy device. It is already there....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest