Other than direct api calls, i have a hub i can only reach through curl api calls.
I can extract all info (and hope to create separate template sensors afterwards) by giving this curl command:
curl -X POST -d '{"seq":1, "method":"objmgr_get_objects_init"}' http://192.168.xxx.xxx/iungo/api_request
How can i create a sensor (rest, or jsonrest maybe?) from this command? do i need to use a shell_command? but how to get the result in the sensor
The other (json)rest sensors i have have a full url as resource, which in this case isn’t available onfortunately.
or is this the way:
sensor:
- platform: command_line
command: curl -X POST -d ‘{“seq”:1, “method”:“objmgr_get_objects_init”}’ http://192.168.xxx.xxx/iungo/api_request
name: Iungo Sensor
A bit afraid to run the system down if this is incorrect, so rather hear from the community first…
- platform: command_line
command: "curl -X POST -d '{"seq":1, "method":"objmgr_get_objects_init"}' http://192.168.xxx.xxx/iungo/api_request"
name: Iungo Sensor
2018-02-05 08:39:58 ERROR (SyncWorker_0) [homeassistant.util.yaml] while parsing a block mapping
in "/config/sensors/sensor_template.yaml", line 6, column 3
expected <block end>, but found '<scalar>'
in "/config/sensors/sensor_template.yaml", line 7, column 32
2018-02-05 08:39:58 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: while parsing a block mapping
in "/config/sensors/sensor_template.yaml", line 6, column 3
expected <block end>, but found '<scalar>'
in "/config/sensors/sensor_template.yaml", line 7, column 32
Trying to create a sensor for a water monitor and my postman request works great, but I may be missing something obvious as I can’t make it work with the command_line: