Changes via jsondb help

I have been using Hestipi for over a year but basically only as a dumb thermostat. I am once again trying to integrate it with Alexa so everyone in my home can easily control the temp by voice and the Alexa app.

I found @yojuan 's post, but I am struggling to understand how I add the metadata now that jsondb is used instead of the default.items file. I do not understand much about programming, so please excuse my lack of technical language and let me know if I’ve got this all backwards.

I figured out how to add metadata via the REST API, but I do not understand how to format it. From the Openhab documentation and yojuan’s post, I need to alter following to several items:

Number MyTempProxy "Temperature [%.0f °F]" <temperature> (Thermostat) { mqtt=">[mosquitto:hestia/local/temperature:state:*:default]", alexa="TemperatureSensor.temperature" [scale="Fahrenheit"] }
Number TempMaxSetpoint "Temperature Max Setpoint[%.0f °F]" (Thermostat) { mqtt=">[mosquitto:hestia/local/tempmaxsetpoint:state:*:default],<[mosquitto:hestia/local/settempmaxsetpoint:state:default]", alexa="ThermostatController.upperSetpoint" [scale="Fahrenheit"] }
Number TempMinSetpoint "Temperature Min Setpoint[%.0f °F]" (Thermostat) { mqtt=">[mosquitto:hestia/local/tempminsetpoint:state:*:default],<[mosquitto:hestia/local/settempminsetpoint:state:default]", alexa="ThermostatController.lowerSetpoint" [scale="Fahrenheit"]}

I assume I need to POST metadata in a name space labeled “alexa” and in the body insert something like: {alexa=“TemperatureSensor.temperature” [scale=“Fahrenheit”] }
But that’s clearly not the correct format. Could someone please assist me with this?

The full JSON for a metadata entry on an Item will be something like

"metadata": {
  "alexa": {
    "value": "ThermostatController.upperSetpoint"
    "config": {
        "scale": "Fahrenheit"
    }
  }
},

The REST API endpoint (assuming it’s still the same in OH 3 (my HestiaPi is offline at the moment)) is a PUT on /items/{itemname}/metadata/{namespace}.

The {itemname} is self explanatory. {namespace} in this case is “alexa”. The JSON to PUT would be

{
  "value": "ThermostatController.upperSetpoint"
  "config": {
      "scale": "Fahrenheit"
  }
}
1 Like

Thank you! I really appreciate your response, that is very helpful.

I can get Alexa and Google to find the device, but seems like I have something wrong as I cannot control it yet. I’ll check out the openhab forum and see if I can get it figured out. Thanks again!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.