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

Devices allow only service selection of Lightbulb and Switch #95

Open
nona00 opened this issue Jun 23, 2021 · 8 comments
Open

Devices allow only service selection of Lightbulb and Switch #95

nona00 opened this issue Jun 23, 2021 · 8 comments

Comments

@nona00
Copy link

nona00 commented Jun 23, 2021

I have the issue that ShellSensor and RFLinkData devices allow only the selection of Lightbulb and Switch in the hap configuration:

grafik

And theses devices are not recognized by IOS (e.g. Eve)

@michbeck100
Copy link
Owner

pimatic-hap supports for type of sensors only specific attributes: https://github.com/michbeck100/pimatic-hap/blob/master/accessories/genericsensor.coffee#L14
As far as I can tell for RFLinkData the attributes have the wrong names. I would suggest you ask the pimatic-rflink developers to change the attribute names, because these names are not aligned with the commonly used attributes from pimatic.
For ShellSensor the same applies, but I believe that you can specify the attribute names using the config. So if you define an attribute e.g. temperature it should work.

@michbeck100
Copy link
Owner

And please ignore the service selection in the config. this applies only to lights and switches. Unfortunately its not possible to hide it programmatically.

@nona00
Copy link
Author

nona00 commented Jun 23, 2021

Thank you very much for your answers. I will report to pimatic-rflink. For ShellSensor I got it working by changing the attributeName from "temp" to "temperature". But after I made the change, it was not reported to Homekit. I had to restart pimatic, then the device were shown. Is this a normal behavior?

@michbeck100
Copy link
Owner

Is this a normal behavior?

At least it implemented that way. So yes this is normal behaviour.

@nona00
Copy link
Author

nona00 commented Jun 24, 2021

I did additional tests:

  • using DummyTemperatureSensor. It seems that it also uses "temp" instead of "temperature" internally. The sensor is shown in Homekit (Eve), but without values. Is this also an issue with the plugin itself?
  • VariablesDevice (assign value of other sensor):
    grafik

grafik

it works in pimatic:

grafik

But when pimatic-hap tries to get the value the following error is fired:
error [pimatic-hap]: Could not call promise: Could not parse expression

@michbeck100
Copy link
Owner

For me it looks like DummyTemperatureSensor uses temperature: https://github.com/pimatic/pimatic/blob/master/lib/devices.coffee#L1112
This is one of the reasons that pimatic-hap uses temperature, too.
Regarding the VariablesDevice: please post the parts of your config to reproduce this error.

@michbeck100 michbeck100 reopened this Jun 24, 2021
@nona00
Copy link
Author

nona00 commented Jun 24, 2021

I did another test with DummyTemperatureSensor and a Variable "temp_aussen" which I added, but the issue is the same. Here are the parts of the config:

`
Variables:
"variables": [
{
"name": "temp_aussen",
"value": 0
}
]

Devices:
{
"variables": [
{
"name": "temperature",
"expression": "$temp_aussen",
"type": "number"
}
],
"xAttributeOptions": [],
"hap": {
"service": "Lightbulb"
},
"id": "temp-aussen-variable",
"name": "temp-Aussen-Variable",
"class": "VariablesDevice"
}

rule (sets variable value from real sensor):

{
  "id": "temp-dummy",
  "name": "Temp Temp Dummy",
  "rule": "when $temp-aussen-F007_TH.temp gets updated then $temp_aussen to $temp-aussen-F007_TH.temp",
  "active": true,
  "logging": true
}

`

grafik

error [pimatic-hap]: Could not call promise: Could not parse expression

I'm using hap 0.11.1. I know that it is not the current version but I do not see in the Changelog anything related to the issue. I'm still on 0.11.1 because of other dependencies to node 4.6.2

@nona00
Copy link
Author

nona00 commented Jun 25, 2021

Strange, but after a restart of pimatic my test above runs fine

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

No branches or pull requests

2 participants