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


Updating to Version 5.170 breaks 'scenes PUT API' - Internal Server Error, error code 500


Recommended Posts

Posted

Hi,

 

On updating to version 5.170.13 the /scenes/{sceneID} PUT API gives an error code 500 and 'Internal Server Error'. 

 

This occurred with both the Admin account and an account with the new access structure.

 

Rolling back to version 5.160.42 it works fine, completing the changes successfully with a 204.

 

Has anyone else had this?  Any workarounds?

Posted (edited)

For me it seems to work.

I can update the name of a scene remotely with
 

Please login or register to see this code.

 

What are you trying to change in the scene structure?

I'm on 5.170.13 even if my signature says something else...

Edited by jgab
  • Topic Author
  • Posted

    Thanks very much for testing. 

     

    I am updating the execution time in a set of conditions with a PUT to /api/scenes/246 with {'conditions': [{'group': 'time', 'isTrigger': True, 'operator': 'match', 'property': 'cron', 'type': 'hour', 'value': ['30', '21', '*', '*', '*', '*']}, {'group': 'time', 'isTrigger': True, 'operator': 'match', 'property': 'cron', 'type': 'hour', 'value': ['00', '22', '*', '*', '*', '*']}, {'group': 'time', 'isTrigger': True, 'operator': 'match', 'property': 'cron', 'type': 'hour', 'value': ['30', '22', '*', '*', '*', '*']}], 'operator': 'any'}

     

    Please login or register to see this image.

    /monthly_2024_11/image.png.b9ba1296cf8e42f4fac9bf25276b35b4.png" />

    Posted

    @StuartR we checked and works normally.

    Could you paste here the whole API for this specific scene?

  • Topic Author
  • Posted

    Hi I am doing the call from Python using request, so it is json_read_device_values = requests.put(f"http://{hcl_host}/api/scenes/246", data=json_text, auth=(hcl_user, hcl_password))

     

    the full JSON is

    {
        "id": 246,
        "name": "Immersion On",
        "description": "",
        "type": "json",
        "roomId": 457,
        "mode": "automatic",
        "maxRunningInstances": 2,
        "icon": "User1007",
        "iconExtension": "png",
        "hidden": false,
        "protectedByPin": false,
        "stopOnAlarm": false,
        "restart": true,
        "enabled": true,
        "content": "[{\"actions\": [{\"args\": [], \"id\": 799, \"action\": \"turnOn\", \"type\": \"single\", \"group\": \"device\"}], \"conditions\": {\"operator\": \"any\", \"conditions\": [{\"property\": \"cron\", \"operator\": \"match\", \"value\": [\"30\", \"21\", \"*\", \"*\", \"*\", \"*\"], \"type\": \"hour\", \"isTrigger\": true, \"group\": \"time\"}, {\"property\": \"cron\", \"operator\": \"match\", \"value\": [\"00\", \"22\", \"*\", \"*\", \"*\", \"*\"], \"type\": \"hour\", \"isTrigger\": true, \"group\": \"time\"}, {\"property\": \"cron\", \"operator\": \"match\", \"value\": [\"30\", \"22\", \"*\", \"*\", \"*\", \"*\"], \"type\": \"hour\", \"isTrigger\": true, \"group\": \"time\"}]}}]",
        "created": 1620570692,
        "isRunning": false,
        "started": 1731292201,
        "categories": [1],
        "sortOrder": 43
    }

     

    Posted (edited)

    Don't update the whole structure - you can't update all fields, ex. the id.
    Just update the content part. This works for me
     

    Please login or register to see this code.

     

    Note that the value of 'content' is a string - that is a json encoded condition expression.

    Edited by jgab
  • Topic Author
  • Posted

    Thanks very much for that, I will upgrade again and test it.

    Posted

    please try to remove spaces from "content"

  • Topic Author
  • Posted

    Thanks trob that was it.  The default behavior of Python json.dumps includes white space after commas and colons.  So bring the content in and out of a dictionary was adding white space.  It appears the upgrade of HC3 to does not like the extra padding.  So stripping it back out before the call works.

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...