anthonywebb / homebridge-cbus

CBus plugin for homebridge
MIT License
35 stars 20 forks source link

Not a big issue - Updated my Pi with the new homebridge-cbus 7 days ago. #108

Closed hexardavies closed 3 years ago

hexardavies commented 3 years ago

Have noticed the following in my log.. measurement address #47 is coming up in the log alot. I do have a current measruing cbus unit on my network. But i use if to turn circuit on and off - when the solar current gets to a selected figure. Can we get this data into homekit??

logs.txt

JasonY00 commented 3 years ago

Hi,

It appears that you have two measurement devices on your network. The 4 channel current measuring device at unit 47 and a 4 channel temperature measurement device at unit 49 by the looks of the data coming through. There is only valid data on channels 1 and 3 of the current measurement unit, updating around every 15sec (you could make this time longer to reduce traffic, say 30sec). Channel 1 (~5.5A) is measuring approximately 10 times the current of channel 3 (~0.6A). Is this by design?

Your temp unit is measuring Ch1 Nothing, Ch2 ~21deg, Ch3 Nothing, Ch4 ~19deg about every 30sec.

Homekit does not have any specification for a current measurement sensor, but if you just want to display your data you can use temperature sensors in homekit to do it. This is exactly what I do as I also have a current measurement unit and tested the temperature sensor development with this. (JamesPickup wrote it). The temp sensor will also work with the single channel c-bus temperature sensor and the 4 channel general input unit. It can also be adapted for humidity quite easily.

Look at how to define a temp sensor in the plugin, paying attention to the need for a channel parameter (1..4 in your case) and you will be off and running in no time.

Remember that automations based on temperature sensors (current in your case) are not possible in the native homekit app, however, if you download the Elgate Eve app, you can create automations there based on temperature (current) if you want.

Hope this help.

Cheers

Jason

hexardavies commented 3 years ago

Jason, I have to update a few files yeah.. I'm not sure on how to complete this - but a little looking into this i will see how to complete this. Yes i have to devices one measureing Current of the mains / solar / circuits & another unti measuring temp on 4 channels. Roof temp pool temp / air temp - to control my pool solar pump.

JasonY00 commented 3 years ago

Just assign each of the devices discussed above as accessories in your config.json file through homebridge-config-UI-X if you have it as part of your install and you will be off and running.

Remember that you don't define the sourceunit in the config, but the measurement device group address number that the data is being broadcasted on. This is changed in Toolkit within the device configuration windows. I try to set this address to be the same as the device address.

i.e. in in the temperature accessory you use:

{ "type": "temperature", "id": 2, "application": 228, "channel": 1, "name": "Roof Temp" },

not

{ "type": "temperature", "id": 49, "application": 228, "channel": 1, "name": "Roof Temp" },

and for the current measurement unit it should be:

{ "type": "temperature", "id": 1, "application": 228, "channel": 3, "name": "Mains Current" },

not

{ "type": "temperature", "id": 47, "application": 228, "channel": 3, "name": "Mains Current" },

As mentioned these will all come up as temperature sensors in homekit but for automations with these sensors you have to use the free Elgato Eve app. You don't have to configure this app. It will pick up all of the apple home configuration but will add extra functionality.

Let us know how you go.

Cheers

Jason

hexardavies commented 3 years ago

Yeah all work now.... copyed json file for your ref.

    {
        "type": "temperature",
        "id": 2,
        "application": 228,
        "channel": 1,
        "name": "Pool Temp",
        "enable": true
    },
    {
        "type": "temperature",
        "id": 2,
        "application": 228,
        "channel": 2,
        "name": "Pool Solar Temp In",
        "enable": true
    },
    {
        "type": "temperature",
        "id": 2,
        "application": 228,
        "channel": 3,
        "name": "Pool Solar Temp Roof",
        "enable": true
    },
    {
        "type": "temperature",
        "id": 2,
        "application": 228,
        "channel": 4,
        "name": "Outside Temp",
        "enable": true
    },
    {
        "type": "temperature",
        "id": 1,
        "application": 228,
        "channel": 1,
        "name": "Power1",
        "enable": true
    },
    {
        "type": "temperature",
        "id": 1,
        "application": 228,
        "channel": 2,
        "name": "Solar Export",
        "enable": true
    },
    {
        "type": "temperature",
        "id": 1,
        "application": 228,
        "channel": 3,
        "name": "Power3",
        "enable": true
    },
    {
        "type": "temperature",
        "id": 1,
        "application": 228,
        "channel": 4,
        "name": "Power4",
        "enable": true
    },
    {
        "type": "trigger",
        "application": 202,
        "id": 0,
        "action": 0,
        "name": "All Lights off"
    }
hexardavies commented 3 years ago

Thanks Jason... just had the wrong id in my json... I was using the ID of the cbus unit not the application id#

hexardavies commented 3 years ago

Time to setup EVE to control the lights and power circuit contractors :)

JasonY00 commented 3 years ago

Great news! Glad to have been of some help.

Have fun.

Jason