Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
[email protected] 0
Witam, mam urządzenie Smogomierz, z którego odczyty chciałbym umieszczać w zmiennych aby móc np sterować taśmą rgb oraz utworzyć urządzenie wirtualne. Dane pobierane są z lokalnego ip http://192.168.5.134/api w postaci
Please login or register to see this code.
Utworzyłem scenę, która potrafi odczytać ale nie mam pojęcia jak to przenieść do zmiennych:
pm10 -> spm10
pm25 -> spm25
temperature -> stemp
pressure -> spres
humiditi -> shumi
scena. która wyświetla w debug:
--[[
%% properties
%% events
%% globals spm25
--]]
local url = "http://192.168.5.134/api"
local http = net.HTTPClient()
http:request(url, {
options = {
method = 'GET',
timeout = 2000
},
success = function(response)
fibaro:debug(response.status)
if response.status == 200 or response.status == 201 then
fibaro:debug(response.data);
end
end,
error = function(err)
fibaro:debug("Error: " .. err)
end
})
Z góry dziękuję za pomoc, ps smogomierz to fajny polski pomysł, podobnie jak strona aqi.eco na którą można przekazywać dane
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.