I think the host is not liking multiple curl calls and it got me thinking that each curl gets all the data needed, so why do I need repeated calls?
I have this in my configuration.yaml:
command_line:
- sensor:
command: "curl -k -u <USER>:<PASSWORD> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
name: "Propane Tank Neevo 371 Gallons"
unique_id: propane_tank_371_gallons
value_template: "{{ value_json[0].Level|float(0) * 2.4 if value_json[0].Level is defined else this.state }}"
scan_interval: 157680000
state_class: measurement
unit_of_measurement: "Gallons"
# 371 Propane
- sensor:
command: "curl -k -u <USER>:<PASSWORD> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
name: "Propane Tank Neevo 629 Gallons"
unique_id: propane_tank_629_gallons
value_template: "{{ value_json[1].Level|float(0) * 1.2 if value_json[1].Level is defined else this.state }}"
scan_interval: 157680000
state_class: measurement
unit_of_measurement: "Gallons"
# 629 Propane
- sensor:
command: "curl -k -u <USER>:<PASSWORD> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
name: "Propane Tank Neevo 255 Gallons"
unique_id: propane_tank_255_gallons
value_template: "{{ value_json[3].Level|float(0) * 1.2 if value_json[2].Level is defined else this.state }}"
scan_interval: 157680000
state_class: measurement
unit_of_measurement: "Gallons"
# 255 Propane
- sensor:
command: "curl -k -u <USER>:<PASSWORD> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
name: "Propane Tank Neevo 76 Gallons"
unique_id: propane_tank_76_gallons
value_template: "{{ value_json[4].Level|float(0) * 1.2 if value_json[3].Level is defined else this.state }}"
scan_interval: 157680000
state_class: measurement
unit_of_measurement: "Gallons"
#76 Propane
- sensor:
command: "curl -k -u <USER>:<PASSWORD> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
name: "Propane Tank Neevo 125 Gallons"
unique_id: propane_tank_125_gallons
value_template: "{{ value_json[5].Level|float(0) * 1.2 if value_json[4].Level is defined else this.state }}"
scan_interval: 157680000
state_class: measurement
unit_of_measurement: "Gallons"
# 125 Propane
- sensor:
command: "curl -k -u <USER>:<PASSWORD> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
name: "Propane Tank Neevo 630 Gallons"
unique_id: propane_tank_630_gallons
value_template: "{{ value_json[2].Level|float(0) * 2.4 if value_json[5].Level is defined else this.state }}"
scan_interval: 157680000
state_class: measurement
unit_of_measurement: "Gallons"
# 630 Propane
- sensor:
command: "curl -k -u <USER>:<PASSWORD> https://ws.otodatanetwork.com/neevoapp/v1/DataService.svc/GetAllDisplayPropaneDevices --header Content-Type:application/json"
name: "Propane Tank Neevo 6 Gallons"
unique_id: propane_tank_6_gallons
value_template: "{{ value_json[6].Level|float(0) * 2.4 if value_json[6].Level is defined else this.state }}"
scan_interval: 157680000
state_class: measurement
unit_of_measurement: "Gallons"
# ??? Propane
Each curl call yields this response:
>
> [{"CompanyFillRequestAvailable":false,"CompanyId":"29014dc1-acd3-4abe-9e03-0054f48393da","CompanyImageId":null,"CompanyName":"yyyy Energy Inc.","CompanySupportPhoneNumber":null,"CustomName":"371","DealerId":"0148e47d-980b-4f4a-bd5c-c835e48c8a02","Id":"c99fd97d-2d7e-437f-a55b-9b4bd46f2701","IsOwner":true,"Latitude":yyyy1872,"Level":9,"Longitude":-xxxxx289,"NotifyAt1":40.00,"NotifyAt2":25.00,"NotifyCriticalLevels":true,"NotifyDispatch":false,"NotifyDispatchEnabled":false,"NotifyFillDetection":true,"Product":"Propane","SensorMaxLevel":null,"SensorMinLevel":null,"SerialNumber":20196761,"TankCapacity":908.49,"TankFormType":1,"TankLastPressure":null,"TankPressureDisplayUnitSymbol":"kPa","TankPrimaryValueType":0,"ThemeInfo":null},{"CompanyFillRequestAvailable":false,"CompanyId":"29014dc1-acd3-4abe-9e03-0054f48393da","CompanyImageId":null,"CompanyName":"yyyy Energy Inc.","CompanySupportPhoneNumber":null,"CustomName":"629","DealerId":"0148e47d-980b-4f4a-bd5c-c835e48c8a02","Id":"236d578d-f835-4e41-8a09-d20a93df50b3","IsOwner":true,"Latitude":yyyy5841,"Level":75,"Longitude":-xxxxx338,"NotifyAt1":30.00,"NotifyAt2":20.00,"NotifyCriticalLevels":true,"NotifyDispatch":false,"NotifyDispatchEnabled":false,"NotifyFillDetection":true,"Product":"Propane","SensorMaxLevel":null,"SensorMinLevel":null,"SerialNumber":20527575,"TankCapacity":454.24,"TankFormType":1,"TankLastPressure":null,"TankPressureDisplayUnitSymbol":"kPa","TankPrimaryValueType":0,"ThemeInfo":null},{"CompanyFillRequestAvailable":false,"CompanyId":"29014dc1-acd3-4abe-9e03-0054f48393da","CompanyImageId":null,"CompanyName":"yyyy Energy Inc.","CompanySupportPhoneNumber":null,"CustomName":"630 Correct","DealerId":"0148e47d-980b-4f4a-bd5c-c835e48c8a02","Id":"a86e10ad-cb5e-449d-a606-ffdae0e1c769","IsOwner":true,"Latitude":yyyy5976,"Level":72,"Longitude":-yyyy9904,"NotifyAt1":30.00,"NotifyAt2":20.00,"NotifyCriticalLevels":true,"NotifyDispatch":true,"NotifyDispatchEnabled":false,"NotifyFillDetection":true,"Product":"Propane","SensorMaxLevel":null,"SensorMinLevel":null,"SerialNumber":24045716,"TankCapacity":908.49,"TankFormType":1,"TankLastPressure":null,"TankPressureDisplayUnitSymbol":"kPa","TankPrimaryValueType":0,"ThemeInfo":null},{"CompanyFillRequestAvailable":false,"CompanyId":"29014dc1-acd3-4abe-9e03-0054f48393da","CompanyImageId":null,"CompanyName":"yyyy Energy Inc.","CompanySupportPhoneNumber":null,"CustomName":"255","DealerId":"0148e47d-980b-4f4a-bd5c-c835e48c8a02","Id":"b9310be9-b276-4294-b09a-11ac67b20cfd","IsOwner":true,"Latitude":yyyy3741,"Level":64,"Longitude":-yyyy3814,"NotifyAt1":30.00,"NotifyAt2":20.00,"NotifyCriticalLevels":true,"NotifyDispatch":false,"NotifyDispatchEnabled":false,"NotifyFillDetection":true,"Product":"Propane","SensorMaxLevel":null,"SensorMinLevel":null,"SerialNumber":24122799,"TankCapacity":454.24,"TankFormType":1,"TankLastPressure":null,"TankPressureDisplayUnitSymbol":"kPa","TankPrimaryValueType":0,"ThemeInfo":null},{"CompanyFillRequestAvailable":false,"CompanyId":"29014dc1-acd3-4abe-9e03-0054f48393da","CompanyImageId":null,"CompanyName":"yyyy Energy Inc.","CompanySupportPhoneNumber":null,"CustomName":"76","DealerId":"0148e47d-980b-4f4a-bd5c-c835e48c8a02","Id":"8f3c2705-39cc-461e-aff5-9251c2eefb5a","IsOwner":true,"Latitude":yyyy0257,"Level":72,"Longitude":-yyyy9472,"NotifyAt1":30.00,"NotifyAt2":20.00,"NotifyCriticalLevels":true,"NotifyDispatch":true,"NotifyDispatchEnabled":false,"NotifyFillDetection":true,"Product":"Propane","SensorMaxLevel":null,"SensorMinLevel":null,"SerialNumber":24470704,"TankCapacity":454.24,"TankFormType":1,"TankLastPressure":null,"TankPressureDisplayUnitSymbol":"kPa","TankPrimaryValueType":0,"ThemeInfo":null},{"CompanyFillRequestAvailable":false,"CompanyId":"29014dc1-acd3-4abe-9e03-0054f48393da","CompanyImageId":null,"CompanyName":"yyyy Energy Inc.","CompanySupportPhoneNumber":null,"CustomName":"125 ","DealerId":"0148e47d-980b-4f4a-bd5c-c835e48c8a02","Id":"3c3dcd64-85cc-4961-8489-d210861382ee","IsOwner":true,"Latitude":yyyy0339,"Level":75,"Longitude":-yyyy8042,"NotifyAt1":30.00,"NotifyAt2":20.00,"NotifyCriticalLevels":true,"NotifyDispatch":true,"NotifyDispatchEnabled":false,"NotifyFillDetection":true,"Product":"Propane","SensorMaxLevel":null,"SensorMinLevel":null,"SerialNumber":24554970,"TankCapacity":454.24,"TankFormType":1,"TankLastPressure":null,"TankPressureDisplayUnitSymbol":"kPa","TankPrimaryValueType":0,"ThemeInfo":null}]
What is the easiest/best way to extract all 7 “LEVEL” values and assign each to separate sensor using only a single curl call?
Thank you.