executeCommandLine using /bin/bash - proper way to close session

I’m seeing data coming back from a different BASH script which means I believe OH may be using the same BASH session. Variables used are different for every BASH script I call also.

var String results7 = executeCommandLine(Duration.ofSeconds(5), "/bin/bash", "/etc/openhab/scripts/NWSAlerts.sh")

What is the proper way to close a BASH script after execution? I’m doing this below:

#!/bin/bash
curl  'https://api.weather.gov/alerts/active?zone=ILZ104'  
exit
exit

Best, Jay

With the info you give one cannot tell what your problem is. But pretty sure it’s not the exit code.

But I do can tell that you should not be doing this awkward chaining of commands in the first place.
Use the HTTP binding instead.

Here is an example HTTP Thing you should be able to adapt. It gets the fiorecast from the NWS but the alerts work pretty much the same.

UID: http:url:nws
label: National Weather Service Forecast
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: https://api.weather.gov/gridpoints/PUB/91,101/forecast
  delay: 0
  stateMethod: GET
  refresh: 300
  commandMethod: GET
  contentType: application/json
  timeout: 3000
  bufferSize: 2048
channels:
  - id: Updated
    channelTypeUID: http:datetime
    label: Updated
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.updated
  - id: Generated
    channelTypeUID: http:datetime
    label: Generated Time
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.generatedAt
  - id: Period_1_Name
    channelTypeUID: http:string
    label: Period 1 Name
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].name
  - id: Period_1_Start
    channelTypeUID: http:datetime
    label: Period 1 Start
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].startTime
  - id: Period_1_End
    channelTypeUID: http:datetime
    label: Period 1 End Time
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].endTime
  - id: Period_1_Daytime
    channelTypeUID: http:switch
    label: Period 1 Is Daytime
    description: ""
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[0].isDaytime
  - id: Period_1_Temperature
    channelTypeUID: http:number
    label: Period 1 Temperature
    description: ""
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[0].temperature +
        ' °' + JSON.parse(input).properties.periods[0].temperatureUnit
  - id: Period_1_Temperature_Trend
    channelTypeUID: http:string
    label: Period 1 Temperature Trend
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].temperatureTrend
  - id: Period_1_ProbPrecip
    channelTypeUID: http:number
    label: Period 1 Probability of Precipitation
    description: ""
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[0].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[0].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_1_Dewpoint
    channelTypeUID: http:number
    label: Period 1 Dewpoint
    description: ""
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[0].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[0].dewpoint. unitCode.slice(-1) "
  - id: Period_1_RelativeHumidity
    channelTypeUID: http:number
    label: Period 1 Relative Humidity
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].relativeHumidity.value
      unit: "%"
  - id: Period_1_WindSpeed
    channelTypeUID: http:number
    label: Period 1 Wind Speed
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].windSpeed
  - id: Period_1_Wind_Direction
    channelTypeUID: http:string
    label: Period 1 Wind Direction
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].windDirection
  - id: Period_1_Icon_URL
    channelTypeUID: http:string
    label: Period 1 Icon URL
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].icon
  - id: Period_1_Short_Forecast
    channelTypeUID: http:string
    label: Period 1 Short Forecast
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].shortForecast
  - id: Period_1_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 1 Detailed Forecast
    description: ""
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[0].detailedForecast
  - id: Period_2_Name
    channelTypeUID: http:string
    label: Period 2 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].name
  - id: Period_2_Start
    channelTypeUID: http:datetime
    label: Period 2 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].startTime
  - id: Period_2_End
    channelTypeUID: http:datetime
    label: Period 2 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].endTime
  - id: Period_2_Daytime
    channelTypeUID: http:switch
    label: Period 2 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[1].isDaytime
  - id: Period_2_Temperature
    channelTypeUID: http:number
    label: Period 2 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[1].temperature +
        ' °' + JSON.parse(input).properties.periods[1].temperatureUnit
  - id: Period_2_Temperature_Trend
    channelTypeUID: http:string
    label: Period 2 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].temperatureTrend
  - id: Period_2_ProbPrecip
    channelTypeUID: http:number
    label: Period 2 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[1].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[1].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_2_Dewpoint
    channelTypeUID: http:number
    label: Period 2 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[1].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[1].dewpoint. unitCode.slice(-1) "
  - id: Period_2_RelativeHumidity
    channelTypeUID: http:number
    label: Period 2 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].relativeHumidity.value
      unit: "%"
  - id: Period_2_WindSpeed
    channelTypeUID: http:number
    label: Period 2 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].windSpeed
  - id: Period_2_Wind_Direction
    channelTypeUID: http:string
    label: Period 2 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].windDirection
  - id: Period_2_Icon_URL
    channelTypeUID: http:string
    label: Period 2 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].icon
  - id: Period_2_Short_Forecast
    channelTypeUID: http:string
    label: Period 2 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].shortForecast
  - id: Period_2_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 2 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[1].detailedForecast
  - id: Period_3_Name
    channelTypeUID: http:string
    label: Period 3 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].name
  - id: Period_3_Start
    channelTypeUID: http:datetime
    label: Period 3 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].startTime
  - id: Period_3_End
    channelTypeUID: http:datetime
    label: Period 3 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].endTime
  - id: Period_3_Daytime
    channelTypeUID: http:switch
    label: Period 3 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[2].isDaytime
  - id: Period_3_Temperature
    channelTypeUID: http:number
    label: Period 3 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[2].temperature +
        ' °' + JSON.parse(input).properties.periods[2].temperatureUnit
  - id: Period_3_Temperature_Trend
    channelTypeUID: http:string
    label: Period 3 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].temperatureTrend
  - id: Period_3_ProbPrecip
    channelTypeUID: http:number
    label: Period 3 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[2].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[2].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_3_Dewpoint
    channelTypeUID: http:number
    label: Period 3 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[2].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[2].dewpoint. unitCode.slice(-1) "
  - id: Period_3_RelativeHumidity
    channelTypeUID: http:number
    label: Period 3 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].relativeHumidity.value
      unit: "%"
  - id: Period_3_WindSpeed
    channelTypeUID: http:number
    label: Period 3 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].windSpeed
  - id: Period_3_Wind_Direction
    channelTypeUID: http:string
    label: Period 3 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].windDirection
  - id: Period_3_Icon_URL
    channelTypeUID: http:string
    label: Period 3 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].icon
  - id: Period_3_Short_Forecast
    channelTypeUID: http:string
    label: Period 3 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].shortForecast
  - id: Period_3_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 3 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[2].detailedForecast
  - id: Period_4_Name
    channelTypeUID: http:string
    label: Period 4 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].name
  - id: Period_4_Start
    channelTypeUID: http:datetime
    label: Period 4 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].startTime
  - id: Period_4_End
    channelTypeUID: http:datetime
    label: Period 4 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].endTime
  - id: Period_4_Daytime
    channelTypeUID: http:switch
    label: Period 4 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[3].isDaytime
  - id: Period_4_Temperature
    channelTypeUID: http:number
    label: Period 4 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[3].temperature +
        ' °' + JSON.parse(input).properties.periods[3].temperatureUnit
  - id: Period_4_Temperature_Trend
    channelTypeUID: http:string
    label: Period 4 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].temperatureTrend
  - id: Period_4_ProbPrecip
    channelTypeUID: http:number
    label: Period 4 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[3].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[3].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_4_Dewpoint
    channelTypeUID: http:number
    label: Period 4 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[3].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[3].dewpoint. unitCode.slice(-1) "
  - id: Period_4_RelativeHumidity
    channelTypeUID: http:number
    label: Period 4 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].relativeHumidity.value
      unit: "%"
  - id: Period_4_WindSpeed
    channelTypeUID: http:number
    label: Period 4 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].windSpeed
  - id: Period_4_Wind_Direction
    channelTypeUID: http:string
    label: Period 4 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].windDirection
  - id: Period_4_Icon_URL
    channelTypeUID: http:string
    label: Period 4 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].icon
  - id: Period_4_Short_Forecast
    channelTypeUID: http:string
    label: Period 4 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].shortForecast
  - id: Period_4_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 4 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[3].detailedForecast
  - id: Period_5_Name
    channelTypeUID: http:string
    label: Period 5 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].name
  - id: Period_5_Start
    channelTypeUID: http:datetime
    label: Period 5 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].startTime
  - id: Period_5_End
    channelTypeUID: http:datetime
    label: Period 5 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].endTime
  - id: Period_5_Daytime
    channelTypeUID: http:switch
    label: Period 5 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[4].isDaytime
  - id: Period_5_Temperature
    channelTypeUID: http:number
    label: Period 5 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[4].temperature +
        ' °' + JSON.parse(input).properties.periods[4].temperatureUnit
  - id: Period_5_Temperature_Trend
    channelTypeUID: http:string
    label: Period 5 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].temperatureTrend
  - id: Period_5_ProbPrecip
    channelTypeUID: http:number
    label: Period 5 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[4].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[4].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_5_Dewpoint
    channelTypeUID: http:number
    label: Period 5 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[4].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[4].dewpoint. unitCode.slice(-1) "
  - id: Period_5_RelativeHumidity
    channelTypeUID: http:number
    label: Period 5 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].relativeHumidity.value
      unit: "%"
  - id: Period_5_WindSpeed
    channelTypeUID: http:number
    label: Period 5 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].windSpeed
  - id: Period_5_Wind_Direction
    channelTypeUID: http:string
    label: Period 5 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].windDirection
  - id: Period_5_Icon_URL
    channelTypeUID: http:string
    label: Period 5 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].icon
  - id: Period_5_Short_Forecast
    channelTypeUID: http:string
    label: Period 5 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].shortForecast
  - id: Period_5_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 5 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[4].detailedForecast
  - id: Period_6_Name
    channelTypeUID: http:string
    label: Period 6 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].name
  - id: Period_6_Start
    channelTypeUID: http:datetime
    label: Period 6 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].startTime
  - id: Period_6_End
    channelTypeUID: http:datetime
    label: Period 6 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].endTime
  - id: Period_6_Daytime
    channelTypeUID: http:switch
    label: Period 6 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[5].isDaytime
  - id: Period_6_Temperature
    channelTypeUID: http:number
    label: Period 6 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[5].temperature +
        ' °' + JSON.parse(input).properties.periods[5].temperatureUnit
  - id: Period_6_Temperature_Trend
    channelTypeUID: http:string
    label: Period 6 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].temperatureTrend
  - id: Period_6_ProbPrecip
    channelTypeUID: http:number
    label: Period 6 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[5].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[5].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_6_Dewpoint
    channelTypeUID: http:number
    label: Period 6 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[5].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[5].dewpoint. unitCode.slice(-1) "
  - id: Period_6_RelativeHumidity
    channelTypeUID: http:number
    label: Period 6 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].relativeHumidity.value
      unit: "%"
  - id: Period_6_WindSpeed
    channelTypeUID: http:number
    label: Period 6 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].windSpeed
  - id: Period_6_Wind_Direction
    channelTypeUID: http:string
    label: Period 6 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].windDirection
  - id: Period_6_Icon_URL
    channelTypeUID: http:string
    label: Period 6 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].icon
  - id: Period_6_Short_Forecast
    channelTypeUID: http:string
    label: Period 6 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].shortForecast
  - id: Period_6_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 6 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[5].detailedForecast
  - id: Period_7_Name
    channelTypeUID: http:string
    label: Period 7 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].name
  - id: Period_7_Start
    channelTypeUID: http:datetime
    label: Period 7 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].startTime
  - id: Period_7_End
    channelTypeUID: http:datetime
    label: Period 7 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].endTime
  - id: Period_7_Daytime
    channelTypeUID: http:switch
    label: Period 7 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[6].isDaytime
  - id: Period_7_Temperature
    channelTypeUID: http:number
    label: Period 7 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[6].temperature +
        ' °' + JSON.parse(input).properties.periods[6].temperatureUnit
  - id: Period_7_Temperature_Trend
    channelTypeUID: http:string
    label: Period 7 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].temperatureTrend
  - id: Period_7_ProbPrecip
    channelTypeUID: http:number
    label: Period 7 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[6].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[6].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_7_Dewpoint
    channelTypeUID: http:number
    label: Period 7 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[6].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[6].dewpoint. unitCode.slice(-1) "
  - id: Period_7_RelativeHumidity
    channelTypeUID: http:number
    label: Period 7 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].relativeHumidity.value
      unit: "%"
  - id: Period_7_WindSpeed
    channelTypeUID: http:number
    label: Period 7 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].windSpeed
  - id: Period_7_Wind_Direction
    channelTypeUID: http:string
    label: Period 7 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].windDirection
  - id: Period_7_Icon_URL
    channelTypeUID: http:string
    label: Period 7 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].icon
  - id: Period_7_Short_Forecast
    channelTypeUID: http:string
    label: Period 7 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].shortForecast
  - id: Period_7_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 7 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[6].detailedForecast
  - id: Period_8_Name
    channelTypeUID: http:string
    label: Period 8 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].name
  - id: Period_8_Start
    channelTypeUID: http:datetime
    label: Period 8 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].startTime
  - id: Period_8_End
    channelTypeUID: http:datetime
    label: Period 8 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].endTime
  - id: Period_8_Daytime
    channelTypeUID: http:switch
    label: Period 8 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[7].isDaytime
  - id: Period_8_Temperature
    channelTypeUID: http:number
    label: Period 8 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[7].temperature +
        ' °' + JSON.parse(input).properties.periods[7].temperatureUnit
  - id: Period_8_Temperature_Trend
    channelTypeUID: http:string
    label: Period 8 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].temperatureTrend
  - id: Period_8_ProbPrecip
    channelTypeUID: http:number
    label: Period 8 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[7].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[7].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_8_Dewpoint
    channelTypeUID: http:number
    label: Period 8 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[7].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[7].dewpoint. unitCode.slice(-1) "
  - id: Period_8_RelativeHumidity
    channelTypeUID: http:number
    label: Period 8 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].relativeHumidity.value
      unit: "%"
  - id: Period_8_WindSpeed
    channelTypeUID: http:number
    label: Period 8 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].windSpeed
  - id: Period_8_Wind_Direction
    channelTypeUID: http:string
    label: Period 8 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].windDirection
  - id: Period_8_Icon_URL
    channelTypeUID: http:string
    label: Period 8 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].icon
  - id: Period_8_Short_Forecast
    channelTypeUID: http:string
    label: Period 8 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].shortForecast
  - id: Period_8_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 8 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[7].detailedForecast
  - id: Period_9_Name
    channelTypeUID: http:string
    label: Period 9 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].name
  - id: Period_9_Start
    channelTypeUID: http:datetime
    label: Period 9 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].startTime
  - id: Period_9_End
    channelTypeUID: http:datetime
    label: Period 9 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].endTime
  - id: Period_9_Daytime
    channelTypeUID: http:switch
    label: Period 9 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[8].isDaytime
  - id: Period_9_Temperature
    channelTypeUID: http:number
    label: Period 9 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[8].temperature +
        ' °' + JSON.parse(input).properties.periods[8].temperatureUnit
  - id: Period_9_Temperature_Trend
    channelTypeUID: http:string
    label: Period 9 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].temperatureTrend
  - id: Period_9_ProbPrecip
    channelTypeUID: http:number
    label: Period 9 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[8].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[8].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_9_Dewpoint
    channelTypeUID: http:number
    label: Period 9 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[8].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[8].dewpoint. unitCode.slice(-1) "
  - id: Period_9_RelativeHumidity
    channelTypeUID: http:number
    label: Period 9 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].relativeHumidity.value
      unit: "%"
  - id: Period_9_WindSpeed
    channelTypeUID: http:number
    label: Period 9 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].windSpeed
  - id: Period_9_Wind_Direction
    channelTypeUID: http:string
    label: Period 9 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].windDirection
  - id: Period_9_Icon_URL
    channelTypeUID: http:string
    label: Period 9 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].icon
  - id: Period_9_Short_Forecast
    channelTypeUID: http:string
    label: Period 9 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].shortForecast
  - id: Period_9_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 9 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[8].detailedForecast
  - id: Period_10_Name
    channelTypeUID: http:string
    label: Period 10 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].name
  - id: Period_10_Start
    channelTypeUID: http:datetime
    label: Period 10 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].startTime
  - id: Period_10_End
    channelTypeUID: http:datetime
    label: Period 10 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].endTime
  - id: Period_10_Daytime
    channelTypeUID: http:switch
    label: Period 10 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[9].isDaytime
  - id: Period_10_Temperature
    channelTypeUID: http:number
    label: Period 10 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[9].temperature +
        ' °' + JSON.parse(input).properties.periods[9].temperatureUnit
  - id: Period_10_Temperature_Trend
    channelTypeUID: http:string
    label: Period 10 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].temperatureTrend
  - id: Period_10_ProbPrecip
    channelTypeUID: http:number
    label: Period 10 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[9].probabilityOfPrecipitation.val\
        ue === null) ? 0 :
        JSON.parse(input).properties.periods[9].probabilityOfPrecipitation.valu\
        e"
      unit: "%"
  - id: Period_10_Dewpoint
    channelTypeUID: http:number
    label: Period 10 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[9].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[9].dewpoint. unitCode.slice(-1) "
  - id: Period_10_RelativeHumidity
    channelTypeUID: http:number
    label: Period 10 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].relativeHumidity.value
      unit: "%"
  - id: Period_10_WindSpeed
    channelTypeUID: http:number
    label: Period 10 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].windSpeed
  - id: Period_10_Wind_Direction
    channelTypeUID: http:string
    label: Period 10 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].windDirection
  - id: Period_10_Icon_URL
    channelTypeUID: http:string
    label: Period 10 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].icon
  - id: Period_10_Short_Forecast
    channelTypeUID: http:string
    label: Period 10 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].shortForecast
  - id: Period_10_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 10 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[9].detailedForecast
  - id: Period_11_Name
    channelTypeUID: http:string
    label: Period 11 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].name
  - id: Period_11_Start
    channelTypeUID: http:datetime
    label: Period 11 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].startTime
  - id: Period_11_End
    channelTypeUID: http:datetime
    label: Period 11 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].endTime
  - id: Period_11_Daytime
    channelTypeUID: http:switch
    label: Period 11 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[10].isDaytime
  - id: Period_11_Temperature
    channelTypeUID: http:number
    label: Period 11 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[10].temperature +
        ' °' + JSON.parse(input).properties.periods[10].temperatureUnit
  - id: Period_11_Temperature_Trend
    channelTypeUID: http:string
    label: Period 11 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].temperatureTrend
  - id: Period_11_ProbPrecip
    channelTypeUID: http:number
    label: Period 11 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[10].probabilityOfPrecipitation.va\
        lue === null) ? 0 :
        JSON.parse(input).properties.periods[10].probabilityOfPrecipitation.val\
        ue"
      unit: "%"
  - id: Period_11_Dewpoint
    channelTypeUID: http:number
    label: Period 11 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[10].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[10].dewpoint. unitCode.slice(-1) "
  - id: Period_11_RelativeHumidity
    channelTypeUID: http:number
    label: Period 11 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].relativeHumidity.value
      unit: "%"
  - id: Period_11_WindSpeed
    channelTypeUID: http:number
    label: Period 11 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].windSpeed
  - id: Period_11_Wind_Direction
    channelTypeUID: http:string
    label: Period 11 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].windDirection
  - id: Period_11_Icon_URL
    channelTypeUID: http:string
    label: Period 11 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].icon
  - id: Period_11_Short_Forecast
    channelTypeUID: http:string
    label: Period 11 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].shortForecast
  - id: Period_11_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 11 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[10].detailedForecast
  - id: Period_12_Name
    channelTypeUID: http:string
    label: Period 12 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].name
  - id: Period_12_Start
    channelTypeUID: http:datetime
    label: Period 12 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].startTime
  - id: Period_12_End
    channelTypeUID: http:datetime
    label: Period 12 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].endTime
  - id: Period_12_Daytime
    channelTypeUID: http:switch
    label: Period 12 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[11].isDaytime
  - id: Period_12_Temperature
    channelTypeUID: http:number
    label: Period 12 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[11].temperature +
        ' °' + JSON.parse(input).properties.periods[11].temperatureUnit
  - id: Period_12_Temperature_Trend
    channelTypeUID: http:string
    label: Period 12 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].temperatureTrend
  - id: Period_12_ProbPrecip
    channelTypeUID: http:number
    label: Period 12 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[11].probabilityOfPrecipitation.va\
        lue === null) ? 0 :
        JSON.parse(input).properties.periods[11].probabilityOfPrecipitation.val\
        ue"
      unit: "%"
  - id: Period_12_Dewpoint
    channelTypeUID: http:number
    label: Period 12 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[11].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[11].dewpoint. unitCode.slice(-1) "
  - id: Period_12_RelativeHumidity
    channelTypeUID: http:number
    label: Period 12 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].relativeHumidity.value
      unit: "%"
  - id: Period_12_WindSpeed
    channelTypeUID: http:number
    label: Period 12 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].windSpeed
  - id: Period_12_Wind_Direction
    channelTypeUID: http:string
    label: Period 12 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].windDirection
  - id: Period_12_Icon_URL
    channelTypeUID: http:string
    label: Period 12 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].icon
  - id: Period_12_Short_Forecast
    channelTypeUID: http:string
    label: Period 12 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].shortForecast
  - id: Period_12_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 12 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[11].detailedForecast
  - id: Period_13_Name
    channelTypeUID: http:string
    label: Period 13 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].name
  - id: Period_13_Start
    channelTypeUID: http:datetime
    label: Period 13 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].startTime
  - id: Period_13_End
    channelTypeUID: http:datetime
    label: Period 13 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].endTime
  - id: Period_13_Daytime
    channelTypeUID: http:switch
    label: Period 13 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[12].isDaytime
  - id: Period_13_Temperature
    channelTypeUID: http:number
    label: Period 13 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[12].temperature +
        ' °' + JSON.parse(input).properties.periods[12].temperatureUnit
  - id: Period_13_Temperature_Trend
    channelTypeUID: http:string
    label: Period 13 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].temperatureTrend
  - id: Period_13_ProbPrecip
    channelTypeUID: http:number
    label: Period 13 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[12].probabilityOfPrecipitation.va\
        lue === null) ? 0 :
        JSON.parse(input).properties.periods[12].probabilityOfPrecipitation.val\
        ue"
      unit: "%"
  - id: Period_13_Dewpoint
    channelTypeUID: http:number
    label: Period 13 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[12].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[12].dewpoint. unitCode.slice(-1) "
  - id: Period_13_RelativeHumidity
    channelTypeUID: http:number
    label: Period 13 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].relativeHumidity.value
      unit: "%"
  - id: Period_13_WindSpeed
    channelTypeUID: http:number
    label: Period 13 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].windSpeed
  - id: Period_13_Wind_Direction
    channelTypeUID: http:string
    label: Period 13 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].windDirection
  - id: Period_13_Icon_URL
    channelTypeUID: http:string
    label: Period 13 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].icon
  - id: Period_13_Short_Forecast
    channelTypeUID: http:string
    label: Period 13 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].shortForecast
  - id: Period_13_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 13 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[12].detailedForecast
  - id: Period_14_Name
    channelTypeUID: http:string
    label: Period 14 Name
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].name
  - id: Period_14_Start
    channelTypeUID: http:datetime
    label: Period 14 Start
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].startTime
  - id: Period_14_End
    channelTypeUID: http:datetime
    label: Period 14 End Time
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].endTime
  - id: Period_14_Daytime
    channelTypeUID: http:switch
    label: Period 14 Is Daytime
    configuration:
      onValue: "true"
      offValue: "false"
      stateTransformation: JSONPATH:$.properties.periods[13].isDaytime
  - id: Period_14_Temperature
    channelTypeUID: http:number
    label: Period 14 Temperature
    configuration:
      stateTransformation: JS:| JSON.parse(input).properties.periods[13].temperature +
        ' °' + JSON.parse(input).properties.periods[13].temperatureUnit
  - id: Period_14_Temperature_Trend
    channelTypeUID: http:string
    label: Period 14 Temperature Trend
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].temperatureTrend
  - id: Period_14_ProbPrecip
    channelTypeUID: http:number
    label: Period 14 Probability of Precipitation
    configuration:
      stateTransformation: "JS:|
        (JSON.parse(input).properties.periods[13].probabilityOfPrecipitation.va\
        lue === null) ? 0 :
        JSON.parse(input).properties.periods[13].probabilityOfPrecipitation.val\
        ue"
      unit: "%"
  - id: Period_14_Dewpoint
    channelTypeUID: http:number
    label: Period 14 Dewpoint
    configuration:
      stateTransformation: "JS:|
        JSON.parse(input).properties.periods[13].dewpoint.value + ' °' +
        JSON.parse(input).properties.periods[13].dewpoint. unitCode.slice(-1) "
  - id: Period_14_RelativeHumidity
    channelTypeUID: http:number
    label: Period 14 Relative Humidity
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].relativeHumidity.value
      unit: "%"
  - id: Period_14_WindSpeed
    channelTypeUID: http:number
    label: Period 14 Wind Speed
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].windSpeed
  - id: Period_14_Wind_Direction
    channelTypeUID: http:string
    label: Period 14 Wind Direction
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].windDirection
  - id: Period_14_Icon_URL
    channelTypeUID: http:string
    label: Period 14 Icon URL
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].icon
  - id: Period_14_Short_Forecast
    channelTypeUID: http:string
    label: Period 14 Short Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].shortForecast
  - id: Period_14_Detailed_Forecast
    channelTypeUID: http:string
    label: Period 14 Detailed Forecast
    configuration:
      stateTransformation: JSONPATH:$.properties.periods[13].detailedForecast

Hey @rlkoshak ,

The issue I’m having is very strange, I have a bunch of executeCommandLine calling .SH scripts and it has worked for years.

I just added a few more tied to the Oura Ring API.

What is happening is this (syntax not accurate below) . . .

speedtest = executeCommandLine /bin/bash speedtest.sh
ouraring = executeCommandLine /bin/bash ouraring.sh (simple API URL w/JSON)

They are running at different cron times.

I’m getting output from speedtest on the ouraring output from the logging, which makes me believe that the speedtest BASH session isn’t closing all the way.

The speedtest.sh is using python within the script, not sure that matters.

When I run them manually at the prompt, everything works perfectly.

Here’s what I’m talking about, speedtest stuff first then ouraring next. The try blocks have different variables also.

2025-03-03 11:20:51.234 [ERROR] [org.openhab.core.model.script.OURA                ] - Oura Readiness Score - Error while processing JSON response via CURL. Exception is For input string: "% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   400  100   400    0     0   1269      0 --:--:-- --:--:-- --:--:--  1269
{"data":[{"id":"c4e592b0-fd83-44b9-a91c-825f153adbec","contributors":{"activity_balance":90,"body_temperature":100,"hrv_balance":null,"previous_day_activity":92,"previous_night":98,"recovery_index":61,"resting_heart_rate":93,"sleep_balance":88},"day":"2025-03-03","score":88,"temperature_deviation":-0.07,"temperature_trend_deviation":0.03,"timestamp":"2025-03-03T00:00:00+00:00"}],"next_token":null}"

I’m at a lost . . .

Best, Jay

If the shell scripts were not exiting, you’d be getting timeout errors from OH after five seconds (given your call in the OP). I don’t think you get any output from the script if it times out like that either.

Since you are getting the output and you are not getting timeout errors ther scripts are exiting.

This error indicates that it’s trying to parse the Dload Upload … part of the output as JSON. I’m assuming that’s from your Python script.

Obviously that’s not going to work. Nothing until you get the {“data”:… part is JSON so none of that first part is parsable as such. And OH is showing the raw output of the Python script aparently.

I don’t know the scripts. I don’t know the rules.

But with the information provided I see no indication that the scripts are not exiting. What I see is your scripts are returning stuff you may not expect perhaps and/or your scripts are failing to complete for reasons.

I can’t explain why it works from the command line except that it’s likely running as a different user when OH runs it than you run it as from the command line.

This was a rookie move, when I run the scripts manually the CURL doesn’t show the progress information. When I run them via OH executeCommandLine its outputting the progress information which looks like the speedtest runs.

Adding the -s (silent) on the CURL switch fixed everything.

Best, Jay