rkoshak / sensorReporter

A python based service that receives sensor inputs and publishes them in various ways.
Apache License 2.0
105 stars 41 forks source link

OpenHAB API token #85

Closed DanielDecker closed 3 years ago

DanielDecker commented 3 years ago

added support for openHAB 3.0 REST API (via param openHAB-Version) added support for optional openHAB 3.0 API token authentication (via param API-Token) updated readme with new new config parameters added readme section to explane OH setup with sensor_reporter updated readme config examples to work with OH3 (item names doesn't support '-' and '/') updated readme's to make more clear what data type on the OH3 REST API back end is required

tested the rest_conn.py changes with OH3.1. I didn't tested it with OH2, but setting openHAB-Version 2.0, or removing it from the config resulted in the same HTTP error that I had with your original version. fixes #76

DanielDecker commented 3 years ago

Today I tested the changes in this PR with an OH2.5 server, in short everything works as expected.

If param openHAB-Version is not present in the ini-file or is set to version 2.0 or 2.5 sensors and actors work normally If param openHAB-Version is set to 3.0 or greater the actors stop working with OH2, which is expected since the API changed

DanielDecker commented 3 years ago

edited openhab_rest/README.md and exec/README.md opening a new pull request