Closed Ton1965 closed 4 years ago
ok will do, replay is not fast. any news from @demonio2332 on the gatway ?
i ve asked the full code
No response! negative one :( @demonio2332 any update from your gateway ?
hi @lych did you get your gateway? if yes any news about hacking it? cheers
Hi, @khzd. I haven't got it yet. :( I really hope to receive it next week.
thanks lych, I asked the livolo dev team to send at least the datasheet, but not response yet, hop will get it with your gateway ;)
Hi Here is there response : “Sorry, we won't share the protocol at the stage. ”
Up to us to found the workaround.
Cheers
Hi lync Did you have any update ?
Hi @khzd. I've got it!!! I wasted a day trying to pair the gataway with their app. I figured out that their app doesnt work on most of my android devices. Fortunately, I found a tablet on which the application works fine. I'll start experiments soon.
The gateway sends to the switch a command: ZCL Level Control: Move to Level Level: 108, Transition Time: 0.1 sec - to on Level: 1, Transition Time: 0.1 sec - to off
Awesome! Finally I'm able to control it!
{
zigbeeModel: ['TI0001 '],
model: 'TI0001 ',
description: 'Zigbee switch',
vendor: 'Livolo',
supports: 'brightness',
fromZigbee: [],
toZigbee: [tz.light_brightness],
},
ON
{
"brightness": 108,
"transition": 0.1
}
OFF
{
"brightness": 1,
"transition": 0.1
}
Next step is to read the switch state
@lych Looks like Livolo is coming up with own zigbee-management standard :))))
Looks like this :) But there are still some problems. 1) After the switch power off it doesn't remember that it had already been paired, so it doesn't work if 'permit_join: false' in config. 2) I don't know how to get the switch state. If I tounch the sensor it sends strange command: Also it can answer in right way on ReadAttribute command and return the right state. Is there a way to catch this strange command then send ReadAtribute command and get the switch real state?
If the gateway wants to know the switch state, it sends the command 'ZCL: OnOff togle' to the switch then gets the response ZCL: Default Response Status: Succes and a strange command which I posted above. I think it contains the switch state.
hi @lych thanks for the feed-back, is it promising ?
cheers
Hi @lych
Nice to hear about the latest developments! Thanks a lot for your effort!
- After the switch power off it doesn't remember that it had already been paired, so it doesn't work if 'permit_join: false' in config.
This might be a problem if pairing process requires the switch being close to zigbee2mqtt coordinator since taking the switch out of the wall after a power outage and bringing it to the coordinator is not something I am looking forward for 😄 Hopefully the switch has a good range even for pairing since it is not battery-powered.
Does anybody know how to make zigbee2mqtt send ReadAttribute command?
@Koenkk Could you please help me? Some time ago when I was experimenting, I saw ReadAttribute requests (I don't remember exactly, but probably it was ReadAttrubute OnOff ) from the zigbee2mqqt to the switch and it answered. Now I can't get the same behavior. Only DiscoverAttrubute commands that the swintch answers 'Unsupported command'. Is there a way to send ReadAttribute command?
It is possible an example for genBasic will help: endpoint - it is necessary to find an enpoint that has the genOnOff cluster. genBasic -> genOnOff Attribute IDs can be found in the "zigbee-shepherd" sources. handleCommandResp - response callback.
endpoint.foundation('genBasic', 'read', [
{
attrId: 4
},
{
attrId: 5
},
{
attrId: 7
}
], handleCommandResp);
I'm waiting for my Livolo too and can help more later. My plans are to create a new custom firmware for this chip. I hope, it is unlocked.
@ptvoinfo Thanks
tz.light_brightness
hi do you use the standard one or did you customise it to adapt it to
ON
{ "brightness": 108, "transition": 0.1 }
OFF
{ "brightness": 1, "transition": 0.1 }
i did some unsuccessful test with what you post : I loose systematicaly the link to the device :( how do you keep the link alive ? Cheers NB Good news @ptvoinfo have order one too
tz.light_brightness - I use the standard one. My switch works while 'permit_join: true'
Workaround for getting current switch's state:
{
zigbeeModel: ['TI0001 '],
model: 'TI0001 ',
description: 'Zigbee switch',
vendor: 'Livolo',
supports: 'brightness',
fromZigbee: [fz.light_state],
toZigbee: [tz.on_off, tz.light_brightness],
},
Topic:
zigbee2mqtt/<livolo_id>/get
Payload:
{
"state" : ""
}
To keep the current state of the switch, this topic has to be published periodically. I think, about once a second is enought.
It is not the best solution, of course, but at least something.
So, there is the last problem, how to keep a connection. @khzd Sometimes my switch loses connection too.
@Ton1965 It looks like not a whole pairing process, just some parts of it. Although I'm not sure :)
Hi I've also got myself a 2-gang version of the switch.
I've followed comments in this thread and managed to semi-successfully pair the device with zigbee2mqtt. I've found out that to toggle the second (right) switch you would have to change transition to 0.2 in published message, like this:
{ "brightness": 108, "transition": 0.2 }
Also, with repeated state querying, returned genOnOff message looks like this:
Received zigbee message of type 'devChange' with data '{"cid":"genOnOff","data":{"onOff":3}}'
where onOff is 3 if both switches are on, 2 if only right is on, 1 if only left and 0 if both are off.
I am only able to get this kind of reply the very first time after the switch state has changed, subsequent queries yield no reply from the device.
Another problem is that after pairing the device it only reacts to my commands for about 2-3 minutes. then connection is lost and I get error code 240 and have to re-pair again.
@MrRoch3 I can not believe that Livolo use transition to indicate the switch number :)))
@lych Looks like Livolo is coming up with own zigbee-management standard :))))
You said it yourself =)
@MrRoch3 According to the sniffer log, Livolo always answers about its state, at least my 1-gang does it. Probably, you don't see the answer because of zigbee2mqtt. Because { "brightness": 1 } has state 'ON' whereas we need "OFF". Luckily, it's easy to fix.
I'm afraid that to repair the problem with pairing we need some changes in zigbee-shepherd or even in coordinator firmware.
good progress :) what about to post a debug file so @Koenkk may help to give a hand on this?
hi,sorry my english, add this { zigbeeModel: ['TI0001 '], model: 'TI0001 ', description: 'Zigbee switch', vendor: 'Livolo', supports: 'brightness', fromZigbee: [fz.light_state], toZigbee: [tz.on_off, tz.light_brightness], }, in devices.js, this is correct, restart zigbeemqtt, livolo pairing mode but zigbee mqtt cant read my livolo, some help, thanks
Hi Is your pairing correct? Please poste your dB line for livolo
cant pairing, dont read livolo in zigbeemqtt
Can you change state? Did you change the channel? My works on channel 26.
i dont have idea how change the channel, newbie,jeje
@lindeluci Just add 'channel: 26' string in your configuration.yaml in section 'advanced'. like this:
homeassistant: false
permit_join: true
mqtt:
base_topic: zigbee2mqtt
server: '<your mqtt server address>'
serial:
port: <your coordinator port>
advanced:
channel: 26
log_level: debug
Unfortunately, we still have proplem with pairing and keeping the connection
after change the configuration, get this messge
Something wrong with modelID, probably because of spaces, copy it form your database.db to devices.js and pay attention on spaces.
{"id":6,"type":"EndDevice","ieeeAddr":"0x00124b001838ddb0","nwkAddr":33413,"manufId":0,"manufName":"LIVOLO\u0000\u0010TI0001 ","powerSource":"Mains (single phase)","modelId":"TI0001 ","epList":[6],"status":"online","joinTime":1547316453,"endpoints":{"6":{"profId":260,"epId":6,"devId":0,"inClusterList":[0,3],"outClusterList":[6],"clusters":{}}},"_id":"JEXuMnDSQFl3oJkv"} {"id":6,"type":"EndDevice","ieeeAddr":"0x00124b001838ddb0","nwkAddr":33413,"manufId":0,"manufName":"LIVOLO\u0000\u0010TI0001 ","powerSource":"Mains (single phase)","modelId":"TI0001 ","epList":[6],"status":"online","joinTime":1547316453,"endpoints":{"6":{"profId":260,"epId":6,"devId":0,"inClusterList":[0,3],"outClusterList":[6],"clusters":{"genBasic":{"dir":{"value":1},"attrs":{}},"genIdentify":{"dir":{"value":1},"attrs":{}},"genOnOff":{"dir":{"value":2},"attrs":{}}}}},"_id":"JEXuMnDSQFl3oJkv"}
copy all this?
NO! copy your modelId string (the part that is in quotes) from your database.db to your device.js to zigbeeMidel field. Pay attention on spaces, github parser eats spaces, there is a problem when you copy it form these posts.
ene 12 19:45:08 raspberrypi npm[1755]: zigbee2mqtt:debug 2019-1-12 19:45:08 Received zigbee message of type 'devIncoming' with data '"0x00124b001838ddb0"' of device 'TI0001 ' (0x00124b001838ddb0) ene 12 19:45:08 raspberrypi npm[1755]: zigbee2mqtt:info 2019-1-12 19:45:08 Device incoming... ene 12 19:45:08 raspberrypi npm[1755]: zigbee2mqtt:info 2019-1-12 19:45:08 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"device incoming"}' ene 12 19:45:08 raspberrypi npm[1755]: zigbee2mqtt:debug 2019-1-12 19:45:08 Received zigbee message of type 'devStatus' with data '"online"' of device 'TI0001 ' (0x00124b001838ddb0)
i have the gateway but is impossible pairing with livolo app, i have home assistant, but cant found livolo with zigbeemqtt
Is it possible that this issue is that of the same as these similar switches? (Perhaps the same Chinese manufacturer? I'm not sure if Zigbee is similar to Bluetooth with partial mac address linked to manufacturers etc, but the first 9 or 10 characters of the identifier is the same '0x00124b00')
Hi @lych Can you confirm that you do not use this section in devices.js, recommended early ?
configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const actions = [ (cb) => device.bind('genOnOff', coordinator, cb), (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), ];
execute(device, actions, callback);
},
},
Hi, @khzd I do not use it.
Thanks @lych About loosing connection I saw somewhere in the z2m code that Xiaomi and routers are trigerred regularly because they go in sleep mode, what about to test that? Ps I’m fare from my devices for two weeks
hi, decompile the livolo app, i can see that works with eclipse paho, i dont know if this info can help.
Hi @lindeluci, it can't help. Their app works with their cloud and their gateway works with this cloud. They both can't work without it (at least now) so we have to get rid of them.
Hi @lindeluci Well done, now it will be a white box ;) can you give more info about the micro-code We are interested to flach it with a custom code to become more standard ;) @ptvinfo will probably be interrested, he order one a week ago :) We need to know -why it work only on channel 26 -how to get it permanently connected -confirm on off protocol, use brightness!!! -...
Thanks for your contribution
Hi, sorry for off topic, I've managed to create plugin for homebridge which controls these switchers through Livolo's bridge and Livolo's server. The code is far from good, because it was "one night hackathon" for me and I didn't plan to show it to anyone, but I can share code if anyone interested. Basically I mimic their Android app, they use MQTT to notify app that switcher's state changed and I think this could be helpful for reverse engineering their protocol between switch and bridge.
I have bought a Livolo zigbee switch like this one: https://www.aliexpress.com/item/Livolo-Touch-ZIGBEE/32918552579.html?spm=a2g0v.10010108.1000016%2FB.1.12754ab2JVEKJU
It seems to be a good option for its price.
The original Livolo instruction is to buy their own gateway and pair using their application. The pairing should be done by keeping a switch button pressed for 5 seconds. It should beep and pair after that.
The problem is it does not want to pair to zigbee2mqtt. I tried the following:
All the time I kept the device close to the zigbee stick.
I just could not observe any activity in zigbee2mqtt log in any of these cases. I have double checked that 'permit_join' is set to true and log_level set to 'debug'. I even tried to run zigbee2mqtt together with DEBUG=zigbee-shepherd* - no result.
Does anyone have any suggestions/advices/ideas? It would be very nice to add support to this device since this model seems to be much more attractive than the corresponding RF model.