Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

pimatic-log-reader integration #42

Closed
hg-smart opened this issue Sep 20, 2016 · 5 comments
Closed

pimatic-log-reader integration #42

hg-smart opened this issue Sep 20, 2016 · 5 comments

Comments

@hg-smart
Copy link

hg-smart commented Sep 20, 2016

hello i am using pimatic-logreader to read the temperature from an external sensor (logfile)

pimatic-log-reader

 {
      "plugin": "log-reader"
 },
{
      "id": "temperature-from-logfile-bad-h1",
      "name": "Bad Temperatur",
      "class": "LogWatcher",
      "file": "/home/pi/log/aa_t.log",
      "attributes": [
        {
          "name": "temperature",
          "type": "number",
          "unit": "°C"
        }
      ],
      "lines": [
        {
          "match": "temperature: (.+)",
          "temperature": "$1"
        }
      ]
    },

Is it possible to integrate this into pimatic-hap ?
Could you give me any hints where to pay attention, please.

Thx in advance
hans

@michbeck100
Copy link
Owner

I'll have a look. Generally just 'real' temperature sensors are currently supported.

@hg-smart
Copy link
Author

cool, for testing you could simple create a file with the follwing contents, thx a lot
hans

pi@raspberrypi:~ $ cat /home/pi/log/aa_t.log
temperature: 20.9

@michbeck100
Copy link
Owner

I'm sorry but the log-reader plugin is too "flexible" to integrate it into pimatic-hap. pimatic-hap relies on well-defined interfaces (although well-defined is an elastic term in the JavaScript world).

@michbeck100
Copy link
Owner

I'm reopening this, since the implementation will be the same as for #51

@michbeck100 michbeck100 reopened this Nov 7, 2016
michbeck100 added a commit that referenced this issue Nov 8, 2016
…laced TemperatureAccessory with GenericAccessory, which adds Services based on attributes (#42 and #51)
@michbeck100
Copy link
Owner

da2c11e implements a new generic sensor that currently supports temperature and humidity. Note that these attributes are case sensitive. I did test with the same device example you provided. The new sensor will be included in the next release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants