4

I would like to display the power usage in HomeKit. Unfortunately there is no category to do that in HomeKit. That's why I had the idea to display this not as a power usage but as temperature in HomeKit. The idea is to control HomeKit scenes with the fake temperature sensor.

Unfortunately I have no experience in node-red and it is new for me.

I got the following string from the electricity meter:

success: "true"
response: string
{
    "power":    3.040480,
    "relay":    true
}

I link this to the HomeKit Node which then returns the following error:

Characteristic response cannot be written. 
Try one of these: Name, CurrentTemperature, StatusActive, StatusFault, StatusLowBattery, StatusTampered, Name

After various functions and other adjustments I unfortunately don't get the "temperature" displayed in HomeKit.

I use this: https://flows.nodered.org/node/@plasma2450/node-red-contrib-homekit-bridged

Dodoooh
  • 41
  • 4
  • Where are you defining the service type ? Where is this `Characteristic` key ? – André DS Nov 09 '18 at 10:00
  • actually "power" should be displayed as "CurrentTemperature" but my definition does not work. That's why I get the error. I have tried multiple functions and variables which did not work. – Dodoooh Nov 09 '18 at 10:10
  • 1
    And where is the definition ? Could we get more code please ? :) – André DS Nov 09 '18 at 10:11
  • Currently I don't have a definition for which one works. As written I tried it with different functions but it doesn't work. The string I get from the electricity meter I mentioned above. – Dodoooh Nov 09 '18 at 12:03

1 Answers1

0

I think you cannot directly link up the 2 nodes. From the error message it suggests that you have passed the payload from meter output to HomeKit node. While the meter output contains response property and it is not supported by HomeKit, your error would occur.

Make sure your payload only consists of the supported Characteristics. You can use a change node to modify the payload, or simply with a a function node

const msg.meterOutput = msg.payload;
// Just a prototype, type checking is required
msg.payload = {
    currentTemperature: msg.meterOutput.response.power
}
return msg;
Keni
  • 57
  • 3