thkl / hap-homematic

a AddOn for HomeMatic CCU3 (Raspberrymatic) that will bring HomeKit to your CCU
MIT License
221 stars 25 forks source link

readiness test on rock64 (pivccu3) #2

Closed v0r73x closed 4 years ago

v0r73x commented 4 years ago

sorry to disturb you once more @thkl

this is my rooms with devices in it image

when i want to create the instances the room names are different and shows no usable devices image

is that because of pivccu is different to raspberrymatic and could not parse the rooms ?

thkl commented 4 years ago

No that’s because of that the ccu uses generic names in the database which will be translated in the Ui.

U may create instances without adding devices first. U are able to assign them later and the system will switch the device to the correct instance.

v0r73x commented 4 years ago

again strange thing going on ... i pressed one time to publish instances and now the names are updated ?!? anyway see now number of devices and updated room names now ... image

thkl commented 4 years ago

Oh wow,

Seem like I have to add lots of logging to catch all the strange behavior on user side 😀

v0r73x commented 4 years ago

ok now i added one device - done the room mapping and - it works :) I have my sonoff switch running - now i try to change the service .. keep you updated :) and I share a beer for you :) thx thkl :)

thkl commented 4 years ago

when you add more devices to the same instance , homekit will put the new devices in the same room as the ones you've first added. So one of the big issues with homebrige, that u will lost your device to room mapping if something goes wrong, is gone for ever ;)

v0r73x commented 4 years ago

moin moin again ;)

p.s. the thing with putting empty instances first is a really good idea to have appearing the devices in each room. btw: sometime i create new rooms in homekit and they disappear suddenly - had have you ever be in that situation ? any idea what causes that ?

I started now the migration to hap-homematic. But again - I have some issue which I never faced in the last years with homekit/homebridge/homematic... I have some devices which I can control after setup over hap-homematic - for example the modified cuxd shutter where i have connected an HM-LC-Sw4-PCB and 3 channels vor pressing my Becker Centronics RF Remote :) that works great after importing the instance whith seperate PIN which have mapped this aktor. btw: must the instance HomeMatic_default be added in homekit as well?

but for example a device HM-LC-Sw1-FM (bulp for kinderzimmer) or an HM-LC-Sw4-Ba-PCB is viewed in home App but pressing will not do anything - it will not trigger the aktor....

v0r73x commented 4 years ago

in general : can you let me know me the advantages of using the plugin instead of the homebridge-homematic plugin ? I know for me the sprinkler support is important but to be honest I am not that familiar why its better to have several instances instead of 1 - as the german say: ich seh' den wald vor lauter Bäumen nicht ) ;) btw: if you have neopixels i have a very good python script which offers a http webserver and you can control the neopixel with 1 gpio pin from raspberry - also with the homeapp choosing the colors ;)

v0r73x commented 4 years ago

oh nooo ...the valves are dissapear again ... same as I have on the plugin homebridge-homematic - its working some seconds (10-20se.) and then the both devices disappear automatically out of the homekit app ... ;(

to repreduce it i figured out - if i activate the sprinkler - they work shortly as above described and directly if I enter the device setup section to setup a timer how long they should do irritation it breaks and the devices (i have 2 - still with cuxd emulated...) dissappear

i also tried out to do nothing - the devices diassappear and by reloading the home app on ipad/iphone the devices come up for 10-20 sec and disappear again

i figured out that all HomeMaticSwitchAccessory devices are not switchable from home app on idevice and even when i define them as valve they dissappear

on the sonoff actors i flashed https://github.com/jp112sdl/SonoffHMLOX/wiki/Homematic (i like Jeromes way to make smart home cheaper if you have technicial skills) and integrated them into homematic - if i can reduce a additional "konverter" how better it is ;) regarding KEEP IT SIMPLE In the homematic GUI i can activate and deactive the sonoffs - so it must work - or is there still the issue with event handler what you mentioned in my initial reported issue with Gartenbewässerung ?

if i define both potential valves bacj to switches they are stay permanently stable in home app (ios)

thkl commented 4 years ago

Ok I will Check this

Edit: can u check the valve behavior within the Eve App. I do not have this while using Eve. Valves are up and running and I am able to set the duration time and turn them on or off

v0r73x commented 4 years ago

Hi Thomas, i checked in actual Eve App as well - same behavior as in Home App. Devices there ... but after waiting some seconds they dissapear in Eve ... totally stange... btw: i tried to switch a light in Eve as well HM-LC-Sw1-FM (bulp for kinderzimmer) - its change to active and 1 sec. after back to inactive - and nothing was triggered in homematic - i checked the timestamps there.

thkl commented 4 years ago

Strange all these actors are working fine here.

May you try to add another home and add the instances. Maybe that’s a glitch in the HomeKit database

thkl commented 4 years ago

Ok i've found the root cause of that behavior: I've recently added a check for read only settings of channels. If the accessory has not definition for this check the result is random. So sometimes it works .. sometimes not ;-/ the new npm package 0.0.16 will fix this

v0r73x commented 4 years ago

ok i will try and give you feedback .... many thanks and stay healthy :)

v0r73x commented 4 years ago

ok i updated to 0.0.16 and it seems that pressing the button is now working - i tested with the HM-LC-Sw1-FM (bulb for kinderzimmer) and its triggering now the actor - so that is working.

But i have still the behavior that the valves are disappering after some seconds - if i modify them as switch they stay in home app. I also tried to define the valves as generic - to see if that makes any difference but unfortunatly not ;(

Ok and I done the following:

when i close the home app and reopen it it discovers all devices again but with red marker "no response" on all devices

thkl commented 4 years ago

i've tried this with a HM-LC-Sw1-Fm and a HM-LC-Sw2-FM ..and it works fine with HomeMaticValveAccessory ...

v0r73x commented 4 years ago

ok i tried it with HM-LC-Sw4-Ba-PCB and it disappear. but its only the problem with the valve service - it looks that crashes the hap instance or sth. similar. can i debug that somewhere ?

v0r73x commented 4 years ago

related that pivccu runs in a lx container our setuop should be the same.. i still have no clue how to identify the issue or to deeper debug the hap service logs

thkl commented 4 years ago

ok i tried it with HM-LC-Sw4-Ba-PCB and it disappear. but its only the problem with the valve service - it looks that crashes the hap instance or sth. similar. can i debug that somewhere ?

u can run the hap service in debug mode login (or attach) to the ccu stop the service : /etc/config/rc.d/hap-homematic stop run this in debug: node /usr/local/addons/hap-homematic/index.js -D

this will produce lots of output ;) but a crash is visible

Edit :

switch on looks like

[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [VALVE] set Characteristic.Active 1
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [VALVE] set Characteristic.Active-> HM ON time 10
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Generic] buildAddress ON_TIME
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Generic] seems to be a single datapoint
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Rega] RegaScript object o = dom.GetObject('BidCos-RF.LEQ0625187:2.ON_TIME');if (o){o.State(10);}
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Rega] result is 
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [VALVE] set Characteristic.Active-> HM to ONs
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Generic] buildAddress STATE
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Generic] seems to be a single datapoint
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Rega] RegaScript object o = dom.GetObject('BidCos-RF.LEQ0625187:2.STATE');if (o){o.State(1);}
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [Rega] result is 
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [RPC] event for BidCos-RF.LEQ0625187:2.STATE with value true
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [VALVE] Event result true hm 1
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [VALVE] acTive 1
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [VALVE] inUse 1
[Fri Apr 03 2020 17:27:22 GMT+0200 (CEST)] [HAP Server] [RPC] event for BidCos-RF.LEQ0625187:2.WORKING with value true

10 seconds later

[Fri Apr 03 2020 17:27:31 GMT+0200 (CEST)] [HAP Server] [Generic] buildAddress STATE
[Fri Apr 03 2020 17:27:31 GMT+0200 (CEST)] [HAP Server] [Generic] seems to be a single datapoint
[Fri Apr 03 2020 17:27:31 GMT+0200 (CEST)] [HAP Server] [Rega] RegaScript object o = dom.GetObject('BidCos-RF.LEQ0625187:2.STATE');if (o){o.State(0);}
[Fri Apr 03 2020 17:27:31 GMT+0200 (CEST)] [HAP Server] [Generic] buildAddress STATE
[Fri Apr 03 2020 17:27:31 GMT+0200 (CEST)] [HAP Server] [Generic] seems to be a single datapoint
[Fri Apr 03 2020 17:27:31 GMT+0200 (CEST)] [HAP Server] [Generic] getValue BidCos-RF.LEQ0625187:2.STATE
[Fri Apr 03 2020 17:27:31 GMT+0200 (CEST)] [HAP Server] [CCU] BidCos-RF.LEQ0625187:2.STATE return cached value true
[Fri Apr 03 2020 17:27:32 GMT+0200 (CEST)] [HAP Server] [Rega] result is 
[Fri Apr 03 2020 17:27:32 GMT+0200 (CEST)] [HAP Server] [RPC] event for BidCos-RF.LEQ0625187:2.STATE with value false
[Fri Apr 03 2020 17:27:32 GMT+0200 (CEST)] [HAP Server] [VALVE] Event result false hm 0
[Fri Apr 03 2020 17:27:32 GMT+0200 (CEST)] [HAP Server] [VALVE] acTive 0
[Fri Apr 03 2020 17:27:32 GMT+0200 (CEST)] [HAP Server] [VALVE] inUse 0
[Fri Apr 03 2020 17:27:32 GMT+0200 (CEST)] [HAP Server] [RPC] event for BidCos-RF.LEQ0625187:2.WORKING with value false
v0r73x commented 4 years ago

Hi Thomas,

again thanks for your feedback:

I tried to start the debug but i haven't got the index.js in that part ... image Edit: i think i found the path in the code 👍 image

v0r73x commented 4 years ago

du you know what that means? image

i checked in log the initialization of the device - all looks good image

when I start the debug I see the device initialized correctly then i start the valve to run - the valve stay running but the icon disappear in home app ?!? nothing is changing in the log - i tried after the valve disappear to switch sth other to see if that comes into debug and yes it came... i will let the debug run to see if something will be coming in the next hours in the log because after that "crash" no valve is in the log recognized anymore - i hope you understand what i mean

thkl commented 4 years ago

the warning is not critical .. there is no definition for the channel where the system will check the read only mode so the current channel will be used. (This is only relevant for Powermeter with Switch -> u have to add channel 3 (powermeter) and channel 1 (switch) will be checked) .... blabla bla ..

currently there are no errors .. so i am afraid, the problem is homekit not the HAP Service ... have u tried to add a new home in your app and add the hap instances there ?

thkl commented 4 years ago

and yes u are right .. the npm version is installd in node_modues/hap-homematic .. the path above is my test system ... ;) .. i will add a debug switch into the webUI later

v0r73x commented 4 years ago

currently there are no errors .. so i am afraid, the problem is homekit not the HAP Service ... have u tried to add a new home in your app and add the hap instances there ?

yes i created new home in homeapp and add the hap-instance with the mapped valve in it

v0r73x commented 4 years ago

what i found some minutes later is that the valve was switched of and the timestamp match with the homematic web gui when the aktor was switched off) - and that is what i found in the log image

so only the showing on home app is not working ... 0_o

v0r73x commented 4 years ago

so hap service seems to work but why it switched off after 10 min? It wasn't possible for me to configure the switch - is that a defaul runtime for valves?

what do you suggest? should i disable all other running homebridge instances to ensure that they are not getting in between? How i can reset homekitservice a smart way? i don't want to log any of my idevices out of the cloud and add them again ... that takes hours XD

suggestions are very welcome

thkl commented 4 years ago

default valve time is 0 seconds, which means no time; the valve should stay on u can set the duration time in apples home by sliding upwards in the device detail screen....

and no, do not logout of icloud this will end up in chaos ;o) reseting homekit is not possible .. u will get a fresh new database for every home u add existing bridges in another home should also not affect the current home config

v0r73x commented 4 years ago

ah ok - thanks for bringing light in the dark ;) now i better understand how homekit works . but why the valve was switched off directly after 10 min?? I will try to configure the home completely new - I keep you updated .. ;) p.p.s Im also Berliner ;) I just saw it now - I am living now in the "BaconBelt" (Speckgürtel) XD from Berlin

thkl commented 4 years ago

/etc/config/addons/hap-homematic/ is the path for all the configuration files. there is one file for each device which contains persistent settings (.pstore) ... in your case u should check ccuname_oeq1211481_4_pstore ... the only setting should be "duration":.... with the last value which was set thru homekit Characteristic.SetDuration

v0r73x commented 4 years ago

Hi Thomas,

i had some tryouts with complete new home config from scratch - still same result :( by the way I get it work to set a timer over the homeapp - and yes its written into the .pstore file image

In debug still nothing new - i mentioned some elgato faketimer exception could it be that the icon disappears in the homeapp related to this? Im just guessing because i have still no idea what causes this issue.

v0r73x commented 4 years ago

thats all what the debug gave me:

image

and in middle of setting the timer duration in homeapp for the new choosen devices as irrigator - the icon and timersettings menü disapper in home app

(in log you see i playing a little bit with the timer) and then...broken - no valve anymore

thkl commented 4 years ago

this looks all good .. there is no error .. anyway a very strange behaviour at your side ... btw: version 0.0.18 has now a switch to enable debug logging via webUI

v0r73x commented 4 years ago

hmm Thomas - what kind of setup you use or prefer: rasbianmatic, original ccu3, pivccu3 etc.?

thkl commented 4 years ago

i am using:

an raspberrymatic (Rpi 3) as production system an raspberrymatic (VirtualBox) as development system an pivccu3 (Rpi 3) as integration and test system

choose your fighter ;o)

v0r73x commented 4 years ago

ok after a complete new setup with Homekit (new installed rock64 with pivccu3- complete from scratch) I added 2 channels of an HM-LC-Sw4-Ba-PCB and set them to valve - now they stay constant! I guess there was a problem with the new linux header after updating the rock64 with apt update && upgrade. Looks that something goes wrong with the GPIO header - for example after reboot of the pivccu the reset of CCU3 duty cycle was not reset to zero as well...

There is only one open topic left - can you make it possible that CuxD switches could be used as valve as well?

I though you told in the Gartenbewässerungs issue that there is no Eventlistener on the CuxD. At the moment I have a program running when the HM-LC-Sw4-Ba-PCB is triggered that the CuxD device will be on or of ... so that i can use the vave timer on homeapp - its just a workaround and dirty - I hope there is a possibility to run the CuxD switches as well as valves. looking forward to hear from you - and happy easter :)

thkl commented 4 years ago

i am not sure, CuxD is an virtual interface and sends events as well to rega. But it uses, the last time i checked, binrpc. BinRPC is deprecated and i do not have implement it. U may test this as well. The system will automatic fetch the used interfaces from your ccu and will connect to that interface if there is an device it should use. So just add an CuxD Switch or so, and check the debug log.

The latest version has an option at the webui to restart the service with debug enabled so u do not have to use a terminal anymore ;)

v0r73x commented 4 years ago

Hi Thomas - yes - i saw the new internal area on webgui and already use it :) very helpful to have it ;)

CuxD switches in general working - but if i define them as valve - my initial problem is back - valve devices disappear in home app ;(

thkl commented 4 years ago

WTF ..

looks like i have to install cuxd on the test pivccu and dig into that ...

v0r73x commented 4 years ago

if i can support somehow somewhere - let me know

thkl commented 4 years ago

looks like cuxd is still using xmlrpcbin :( and its a terrible ui/ux ¯_(ツ)

v0r73x commented 4 years ago

just another question: when i use homebridge-hap is there a way to anounce the devices into alexa? i used in the past the homebridge plugin called alexa but this plugin runs on a homebridge and will not discover devices i have in homematic-hap...

I know there is cloud Cloudmatic but that is not a free service

thkl commented 4 years ago

To use Alexa u have to offer a cloud based middleware. This costs money so no .... Siri and Alexa will not get married ;)

thkl commented 4 years ago

Version 0.0.19 has now CUxD event support ...

v0r73x commented 4 years ago

stop ... moment ... incredible c+_+D

thkl commented 4 years ago

wwwwhat ?

v0r73x commented 4 years ago

i tested 0.19 and my initial problem is away - the valves are still persist - no disappear anymore you ǝןqɐʇ ɐ ǝʞıן ǝɯ dıןɟ ;) It's the best Easter present I can get - many thanks and I you want I'll invite you to some beer

thkl commented 4 years ago

oh sounds great \o/ ...

v0r73x commented 4 years ago

timer working great ... icon stay visible all the time - Status information are updated (I had sometimes issues with a cuxd shutter that not was updated to actual state) but all this is solved now :) You made my day (after making a motorcycle tour today)

v0r73x commented 4 years ago

just one question - again (≧︿≦) is it possible to integrate the garagedoor function into homematic-hap? I want to use a sysvar where i define the closing time - i have no contact sensor on it and calculate with sys var. the closing time (to trigger open...openings,closing, closed). As actor I have an HM-LC-Sw1-PCB - it will be nice to go away from Http-GarageDoor plugin on homebridge

thkl commented 4 years ago

image

work in progress

Edit: Just to make that clear, your garage has no sensor which detects where it's open or closed ? How do you know the state without stucking your head out of the window ?

v0r73x commented 4 years ago

ok - you impress me again - thats mostly what i need - but is it working as well without Motion sensor? as you know I am your beta tester ^^ XD let me know when there is something where I can help you - Im just only a sec network admin but with basic skills in node & python. I am member from ccc