Jump to content

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


jwi

Member
  • Posts

    317
  • Joined

  • Last visited

1 Follower

About jwi

Profile information

  • Gender
    Male
  • Country
    Germany
  • Gateway/s
    Home Center 3
    Home Center 2
    Other / Inne

Recent Profile Visitors

744 profile views

jwi's Achievements

Smart User

Smart User (3/8)

53

Reputation

  1. jwi

    Energy report

    @Jasper Waale , I hope you know that ZigBee is still in beta at fibaro, so there may be problems. At the time I coded this script, fibaro didn't have zigbee yet. But let's see, maybe there is a solution. As far as I know, a property of the device must be "power". But you can also try “light”. The "ROLE" is only for filtering and you can set it for each device in the "General" tab. I have 3 different ZigBee devices and all 3 are addressed with "power". But you can also combine a combination of manual and automatically found IDs. For that paste this code at this point: if manually then -- Manual entry of device IDs for evaluation. pwrIDs = {213,224,256,264,285,305,322,339,383,391} else -- Automatic determination of electricity consumers. pwrIDs = fibaro.getDevicesID({interfaces = {"power"}, visible = true, enabled = true}) end -------------insert ------------- mpwrIDs = {999,1201, } -- enter manualy your IDs for _,v in ipairs(mpwrIDs) do -- this code joins both tables table.insert(pwrIDs, v) -- end ----------------------------- Good luck
  2. jwi

    Help with json

    I solved it with string.sub
  3. How i can get this three values in three variables. They are part of a json ouput. I know that I have to convert them from flot to dec. ,"PV1":{"MPP_POWER":["fl_4385EEFA","fl_431E9127","fl_00000000"]} Thanks for any help
  4. Download the HC3 version from my last post. What you have downloaded is the HC2 version.
  5. Maybe you can use or adapt this: HC3-DoorWindowMonitoring0.2.6-en.lua
  6. After a bit of googling, I figured out how to treat the string. r,g,b,w = oldcolor:match("([^,]+),([^,]+),([^,]+),([^,]+)" ) hub.call(212, "setColor", r,g,b,w )
  7. How can I save a color value of an RGBW controller into a variable for later use. I read the value from the API. Example: oldcolor = "0,0,0,170" hub.call(212, "setColor", oldcolor) That does not work. Is there a simple solution for this. Thanks for every hint.
  8. It's pretty simple. 1. Open Swagger in HC3 2. Select RGBPrograms 3. From the 5 options select the middle GET 4. Click on "Try it out" and enter an RGB program ID e.g. 3 (Rainbow) 5. Click on Execute and then on “Download” Now you can now edit the .json file with an editor Alternatively, you can also copy the RGB program from an HC2 via the API, edit it, i.e. change the name and ID, and then insert it as a new RGB program using POST, analogous to the previous GET. First delete the example schema from the program body and insert your new code. The new program is inserted afteryou click “Execute”. Alternatively, you can create a completely new program from an existing template. Here is my alarm program that I copied from my HC2. It creates a red and fast flashing effect. { "id": 219, "name": "Alarm red", "steps": [ { "color": { "r": 255, "g": 0, "b": 0, "w": 0 }, "duration": 40, "transitionTime": 0 }, { "color": { "r": 0, "g": 0, "b": 0, "w": 0 }, "duration": 600, "transitionTime": 0 }, { "color": { "r": 255, "g": 0, "b": 0, "w": 0 }, "duration": 40, "transitionTime": 0 }, { "color": { "r": 0, "g": 0, "b": 0, "w": 0 }, "duration": 600, "transitionTime": 0 } ], "totalDurationTime": 1280, "created": 1698228371, "modified": 1698228371 } ] Good luck
  9. Does anyone know at what intervals the temperature sensor sends its data to the heat controller? Many thanks
  10. No Problem. I used a temporary user and pw for this.
  11. I don't know how to pass the parameters. Maybe someone has an idea what I'm doing wrong. -- function setAPI(audiolevel) print (audiolevel) --This url works fine in a browser --http://192.168.110.11/control/control?set&section=audio&SPEAKERLEVEL=-30 local url = "http://192.168.110.11/control/control" local requestBody = { ["set"] = "set" , --??? ["section"] = "audio", ["SPEAKERLEVEL"] = audiolevel } local requestBody = { ["set"] = "set", ["section"] = "audio", ["SPEAKERLEVEL"] = audiolevel } local extraheaders = { ['Accept'] = 'application/json', ['Content-Type'] = 'text/plain', ['Authorization'] = 'Basic cmF1ZGlvOjVRbnYya0N6Nl9Z' } local selfhttp = net.HTTPClient({timeout=2000}) selfhttp:request(url, { options= { headers = extraheaders, data = json.encode(requestBody), method = "POST" --POST, GET }, success = function(response) data = response.data print('Return Value: '..response.status) print('Data: '..data) end, error = function(message) print("error:", message) end }) end --function local level = -6 setAPI(level) The return status is 200, so the registration works, but the server then shows me a list of commands e.g. read, set, list, factory restore, hidetext, set_profile, read_profile etc Many thanks for your help
  12. jwi

    Energy report

    I'm no longer familiar with the HC2 syntax Just try: fibaro:call(2, 'sendPush', consumption )
  13. jwi

    Energy report

    I no longer have HC2, just replace the word "hub" with "fibaro"
  14. jwi

    Energy report

    Ohh, do you have an HC2?
  15. jwi

    Energy report

    Actually the script is not designed for such short periods of time. But you can do it with a little unsightly hack. In the left side (Conditions/triggers) change the value to 1 hour so that the script starts every hour. " value = { "0", "*", "*", "*", "*", "*" } " In the script itself, replace the line "sek = ndays * 86400" with "sek =3600" as the basis for the calculation. After the lines: local consumption= 'Total consumption-------------: '.. kilowatts .. ' kWh'..'</br>' local tcosts = 'Total costs-------------------: '.. sum .. ' '..currSymbol Add the following lines: hub.alert('push', {2,}, "Last hour consuption:".. kilowatts.. " kWh") -- for push message print (consumption) print (tcosts) And finally, at the beginning of the script, change the variables to this value: local maildays = {} local debugout = false local debughtml = false local defDays = 1 This is how it should work for your needs Good luck
×
×
  • Create New...