Giter VIP home page Giter VIP logo

Comments (39)

lucacalcaterra avatar lucacalcaterra commented on June 11, 2024 2

Yeah ! Before migrate to python , i'll fix this... I need time :-) and a panel with multiple partition to tests

from risco-mqtt-bridge.

fab33 avatar fab33 commented on June 11, 2024 1

Thank you, I will wait for it !

from risco-mqtt-bridge.

lucacalcaterra avatar lucacalcaterra commented on June 11, 2024 1

from risco-mqtt-bridge.

fab33 avatar fab33 commented on June 11, 2024 1

Just find a workaround :

type: `0:${cmd}`,

remove 0: and it will work for all partitions.
Or you can configure arm command with 0:armed 1:armed 2:armed and send it to the topic.

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024 1

@ekkesa Thanks. I will look into partarmed, I'm not using it so I might have missed it. Integration with HA has been working fine for me. However I'm having some issues with the cloud itself. The user I created for this purpose stops working from time to time as if the PIN code got invalidated. Then I have to reassign the very same PIN code as admin and it starts working again.

from risco-mqtt-bridge.

lucacalcaterra avatar lucacalcaterra commented on June 11, 2024

It's manage only 1 partition , but only why i ve no time to test on multiple partition , so ... i must adapt the code. Soon i'll work on it

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

This will be absolutely awesome!!! Thank you for this - Looking forward to the multiple partitions. I have 4 I'd like to manage

from risco-mqtt-bridge.

fab33 avatar fab33 commented on June 11, 2024

Any news for this enhancement ?

from risco-mqtt-bridge.

fab33 avatar fab33 commented on June 11, 2024

@lucacalcaterra , before you made this change, is there a way to arm all partitions ?

from risco-mqtt-bridge.

pergolafabio avatar pergolafabio commented on June 11, 2024

No multiple here :(

from risco-mqtt-bridge.

lucacalcaterra avatar lucacalcaterra commented on June 11, 2024

@fab33 Thanks for you simple workaround... until i'll find time to implement multiple partitions

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Hi,
Have you found any time to perhaps look at the multiple partitions? It will be much appreciated.

Thank you!

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Any progress on the multiple partitions? Alternatively, is it possible to create multiple instances of this for each partition and then manage it with scripts via Home Assistant?

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Unfortunately the tweak of changing line 324 by removing the "0:" and prefixing it to the MQTT payload did not work for me. So, I tweaked the config.js and serverHandler.js and spun up 4 docker containers. I'm able to control the four partitions, but unfortunately when any one of the partitions are in a armed/partially armed state all show armed. So I will have to manipulate them via MQTT and not the alarm_panel_component in HA. At least a start so far.

from risco-mqtt-bridge.

lucacalcaterra avatar lucacalcaterra commented on June 11, 2024

I should implement it... and others features requested...
unfortunately now no time to follow the project due to other jobs that take a lot of time :-(
If someone want fork and contribute... i'll happy to accept PR. Luca

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Appreciate your effort - I had the coding skill I'd love to do it, unfortunately I believe I will make more damage than good. Hopefully we have a skilled user here somewhere.

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024

Just submitted a pull request. Seems to be working but needs more testing. Especially I'm not sure if/how it affects the integration with Home Assistant. Will try to look into it tomorrow.

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Just submitted a pull request. Seems to be working but needs more testing. Especially I'm not sure if/how it affects the integration with Home Assistant. Will try to look into it tomorrow.

I'll be happy to test - Am I correct in I just have to replace the following files with those from your repo:
app.js
panelPoller.js
serverHandler.js

Note: I'm running in docker on RPi

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024

@ekkesa Thank you for your interest. You are right. And please make sure to use new topics.

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Hi,

Just tried that with the following docker compose:

version: '2.0'
services:
risco-mqtt-bridge:
image: lucacalcaterra/risco-mqtt-bridge:armhf
container_name: RiscoMQTTTest
restart: unless-stopped
volumes:
- /devrpi/riscomqtt/config.js:/app/config/config.js
- /devrpi/riscomqtt/logs:/app/logs
- /devrpi/riscomqtt/serverHandler.js:/app/serverHandler.js
- /devrpi/riscomqtt/panelPoller.js:/app/panelPoller.js
environment:
- TZ=Africa/Johannesburg

It spins up, logs in, and I can see it gets the status from the cloud. But it does not report it on MQTT. The logs show connected to MQTT and it states published messages to mqtt, but the 'armstatus' does not arrive for the partitions. It does report on the the detectors, ISONALARM and the event history. I changed the main topic from riscopanel to riscopaneltest.

When publishing on MQTT to, for example, riscopaneltest/armstatus/3/SET I receive the following error in the log:

info: arm/disarm command arrived
warn: arm command not recognized

I tried the following commands to that topic in both upper and lowercase: arm, armed, partarm, partarmed, disarm, disarmed, partially, home_armed, but none worked.

Any suggestions?

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024

@ekkesa Are you missing app.js in your docker config?

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Good catch! Now I feel like an idiot... :-)

Will fix it, and try again...

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

I fixed the app.js link and it is definitely now reporting the status of the different partitions via MQTT, but when I publish a 'SET' command it does not work. I receive this error in the log:

02-02-2020 17:24:55 info: message from mqtt arrived:RiscoHuisTest/armstatus/3/SET/partarmed
02-02-2020 17:24:55 info: arm/disarm command arrived
02-02-2020 17:24:55 warn: arm command not recognized

Not sure where I am going wrong...

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

I did some further testing.

armed - Working
disarmed - Working
partarmed - Not Working
partially - Not Working
armed_home - Working

weird, but hey I'm very happy!

Thank you so much - I will now see how well this integrates with HA.

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

I'm testing scripts currently, and now armed_home seems to not work anymore, even when submitting manually. I have noticed the polling interval is quite temperamental - too long and the session timeout too short and you get errors. I'm currently running on 30 seconds and it seems to hold up on the original code.

Not sure why the it does not recognise the partarmed/partially/armed_home command. I'll keep fiddling and post back here if I can find a pattern..

UPDATE: It was timing luck the previous time. A background process was arming my alarm for partially armed on a schedule. The partarmed is not being recognised in any of the forms.

Appreciate your work on this - Its really awesome!

UPDATE: It seems 'partially' does indeed work. I also noticed that one cant jump from partially armed to armed directly and vice versa. One has to go to disarm first. Something to keep in mind when scripting/automating. Perhaps something that can be added as en enhancement? *if partially armed and receive arm command, first issue disarmed, then issue armed command'

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Another error:
Trying to bypass detectors I receive the following error:

02-02-2020 18:33:53 info: message from mqtt arrived:RiscoHuisTest/dects/2/SET/bypass
/app/app.js:147
case (topic.match(regexpart)[0]):
^

TypeError: Cannot read property '0' of null
at MqttClient.mqttClient.on (/app/app.js:147:35)
at emitThree (events.js:136:13)
at MqttClient.emit (events.js:217:7)
at MqttClient._handlePublish (/app/node_modules/async-mqtt/node_modules/mqtt/lib/client.js:987:12)
at MqttClient._handlePacket (/app/node_modules/async-mqtt/node_modules/mqtt/lib/client.js:336:12)
at work (/app/node_modules/async-mqtt/node_modules/mqtt/lib/client.js:292:12)
at Writable.writable._write (/app/node_modules/async-mqtt/node_modules/mqtt/lib/client.js:302:5)
at doWrite (/app/node_modules/readable-stream/lib/_stream_writable.js:428:64)
at writeOrBuffer (/app/node_modules/readable-stream/lib/_stream_writable.js:417:5)
at Writable.write (/app/node_modules/readable-stream/lib/_stream_writable.js:334:11)

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024

Sorry, it was a stupid mistake. It is now fixed in my repo, please have a look.

So I understand partial is working (except for your finding related to state transitions)? What about session timeouts?

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

I saw it drops a connection error is the polling interval is set above 60000ms, currently have it on 15000ms and it seems to be stable.

Also, I found that when sent two /SET command in quick succession it doesn't queue them, it completes the one it is busy with and discard the ones it received while busy. It seems to be per partition. E.g. I can send disarmed in parallel to all 4 partitions and it will complete them, but I cannot send disarmed and armed in a script without a delay (+-20s) between the commands.

*UPDATE: I tested the disable/bypass of detectors - It works 100%, Thx!

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

I noticed the alarm was not responding via mqtt and noticed this error.

10-02-2020 16:56:31 debug: Class Connection Constructor end,
10-02-2020 16:56:31 info: Connected to MQTT Server,
10-02-2020 16:56:36 debug: Logged...Response code is 302: OK,
10-02-2020 16:56:41 debug: ...site and Pin Code sent...Response code is 302: OK,
10-02-2020 16:56:46 debug: ...Cameras taken...Response code is 200 and no data error: OK,
10-02-2020 16:56:52 debug: ...Event History taken...Response code is 200 and no data error: OK,
10-02-2020 16:56:57 debug: ...Detectors taken...Response code is 200 and no data error: OK,
10-02-2020 16:57:02 debug: return null, overview empty!,
10-02-2020 16:57:02 debug: newarmstatus emitted,
10-02-2020 16:57:02 info: Arming status: [],
10-02-2020 16:57:02 debug: Init function for getting data from Cloud completed: OK,
10-02-2020 16:57:02 debug: polling started...,
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'detectors' of undefined,
at RiscoPoller.riscoPoller.on (/app/app.js:102:62),
at emitNone (events.js:106:13),
at RiscoPoller.emit (events.js:208:7),
at RiscoPoller.init (/app/panelPoller.js:34:10),
at ,
at process._tickCallback (internal/process/next_tick.js:189:7),
(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1),
(node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.,

I have recreated the container via docker-compose, but the issue persists. Any idea what might be causing it?

UPDATE: I see it also creates this error for other properties: "
(node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'parts' of null"

UPDATE2: I tested the unforked version too, and receive the same errors. I opened this issue.

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024

Could you please check if the credentials are still working? Just open a browser a try to log into Risco Cloud.

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

The credentials do work via Chrome when signing in.

Update: I also do not see any errors in the 'EVENT HISTORY' on the web interface.

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

I powered down the panel (Removing power adapter and battery) and restarted it - this seems to have addressed the issue. Still strange that the web interface worked, but the container didn't...

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024

It would be interesting to see the raw JSON coming from the server. Please let me know if it happens again.

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

Will do! Where can I harvest that for you should it happen again?

from risco-mqtt-bridge.

francois-dotnet avatar francois-dotnet commented on June 11, 2024

Hello @swiergot and @ekkesa , i have read through this thread and installed swiergot's fork/branch. I have 2 partitions and 4 groups (of which I only really use 2). I have also experimented with mancioshell's risco-mqtt-home-assistant.
I never have problems receiving the statuses, etc. But I am unable to send commands successfully. I tried disarming and bypassing zones. I tried using a user only setup with one partition and two, I can't find any errors. Would anyone be willing to post their config and how they successfully sent commands? p-l-e-a-s-e :)

from risco-mqtt-bridge.

swiergot avatar swiergot commented on June 11, 2024

@francois-dotnet Here is the bridge config, below is part of HA's configuration.yaml:

alarm_control_panel:

  • platform: mqtt
    name: Partition1
    state_topic: "riscopanel/armstatus/0"
    command_topic: "riscopanel/armstatus/0/SET"
    payload_disarm: "disarmed"
    payload_arm_home: "partially"
    payload_arm_away: "armed"
  • platform: mqtt
    name: Partition2
    state_topic: "riscopanel/armstatus/1"
    command_topic: "riscopanel/armstatus/1/SET"
    payload_disarm: "disarmed"
    payload_arm_home: "partially"
    payload_arm_away: "armed"
  • platform: mqtt
    name: Partition3
    state_topic: "riscopanel/armstatus/2"
    command_topic: "riscopanel/armstatus/2/SET"
    payload_disarm: "disarmed"
    payload_arm_home: "partially"
    payload_arm_away: "armed"
  • platform: mqtt
    name: Partition4
    state_topic: "riscopanel/armstatus/3"
    command_topic: "riscopanel/armstatus/3/SET"
    payload_disarm: "disarmed"
    payload_arm_home: "partially"
    payload_arm_away: "armed"

from risco-mqtt-bridge.

francois-dotnet avatar francois-dotnet commented on June 11, 2024

@swiergot Thanks, my configuration.yaml is the same except I have code_disarm_required: false and define a unique_id (which I intend to remove). ARM and DISARM seems to work now, but not ARM_HOME.
My config.js is also the same except I have:
onalarm: 'triggered', // If you use Home Assistant you must set to 'triggered'
instead of
onalarm: 'onalarm',

Anyone have an example to send bypass MQTT? Mine does not seem to be working:

  - platform: mqtt
    name: test_pir_bypass
    state_topic: "risco/dects/part0/8"
    value_template: "{% if value_json['filter'] == 'bypassed' %}bypass{% else %}unbypass{% endif %}"
    command_topic: "risco/dects/part0/8/SET"
    payload_on: "bypass"
    payload_off: "unbypass"

from risco-mqtt-bridge.

ekkesa avatar ekkesa commented on June 11, 2024

The issue of dropping connections seems to be back. @swiergot where do I scavenge those raw logs for you?

UPDATE: A restart of the container fixes the issue for a short while (few hours) - then it breaks again.

27-06-2020 18:26:16 debug: polling ..., 27-06-2020 18:26:56 debug: return null, overview empty!, 27-06-2020 18:26:56 debug: Polled...counter: 22, 27-06-2020 18:27:11 debug: polling ..., 27-06-2020 18:27:16 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:27:20 debug: return null, overview empty!, 27-06-2020 18:27:20 debug: Polled...counter: 23, 27-06-2020 18:27:35 debug: polling ..., 27-06-2020 18:27:40 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:27:45 debug: return null, overview empty!, 27-06-2020 18:27:45 debug: Polled...counter: 24, 27-06-2020 18:28:00 debug: polling ..., 27-06-2020 18:28:05 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:28:10 debug: return null, overview empty!, 27-06-2020 18:28:10 debug: Polled...counter: 25, 27-06-2020 18:28:25 debug: polling ..., 27-06-2020 18:28:30 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:28:35 debug: return null, overview empty!, 27-06-2020 18:28:35 debug: Polled...counter: 26, 27-06-2020 18:28:50 debug: polling ..., 27-06-2020 18:28:55 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:28:59 debug: return null, overview empty!, 27-06-2020 18:28:59 debug: Polled...counter: 27, 27-06-2020 18:29:14 debug: polling ..., 27-06-2020 18:29:19 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:29:24 debug: return null, overview empty!, 27-06-2020 18:29:24 debug: Polled...counter: 28, 27-06-2020 18:29:34 info: message from mqtt arrived:RiscoAlarm/armstatus/0/SET/disarmed, 27-06-2020 18:29:34 info: arm/disarm command arrived, 27-06-2020 18:29:34 info: message from mqtt arrived:RiscoAlarm/armstatus/1/SET/disarmed, 27-06-2020 18:29:34 info: arm/disarm command arrived, 27-06-2020 18:29:34 info: message from mqtt arrived:RiscoAlarm/armstatus/2/SET/disarmed, 27-06-2020 18:29:34 info: arm/disarm command arrived, 27-06-2020 18:29:34 info: message from mqtt arrived:RiscoAlarm/armstatus/3/SET/disarmed, 27-06-2020 18:29:34 info: arm/disarm command arrived, 27-06-2020 18:29:38 debug: user code is expired? : false, 27-06-2020 18:29:39 debug: polling ..., 27-06-2020 18:29:43 debug: user code is expired? : false, 27-06-2020 18:29:43 debug: user code is expired? : false, 27-06-2020 18:29:47 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:29:50 debug: arm command result ok, 27-06-2020 18:29:53 debug: arm command result ok, 27-06-2020 18:29:55 debug: arm command result ok, 27-06-2020 18:29:55 debug: ...Control Panel State taken and overview not empty... OK, 27-06-2020 18:29:55 debug: Polled...counter: 29, 27-06-2020 18:29:55 debug: newarmstatus emitted, 27-06-2020 18:29:55 info: Arming status: ["partarmed","partarmed","disarmed","partarmed"], 27-06-2020 18:29:55 info: publish messages on MQTT Server, 27-06-2020 18:29:55 info: Status panel infos arrived, 27-06-2020 18:30:10 debug: polling ..., 27-06-2020 18:31:09 debug: user code is expired? : true, 27-06-2020 18:31:09 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:31:13 debug: Logged...Response code is 302: OK, 27-06-2020 18:31:14 debug: ...Control Panel State taken and overview not empty... OK, 27-06-2020 18:31:14 debug: Polled...counter: 30, 27-06-2020 18:31:14 debug: newarmstatus emitted, 27-06-2020 18:31:14 info: Arming status: ["disarmed","partarmed","disarmed","disarmed"], 27-06-2020 18:31:14 info: publish messages on MQTT Server, 27-06-2020 18:31:14 info: Status panel infos arrived, 27-06-2020 18:31:18 error: Exception on arm/disarm command: TypeError: Cannot read property 'text' of undefined, 27-06-2020 18:31:29 debug: polling ..., 27-06-2020 18:33:22 debug: return null, overview empty!, 27-06-2020 18:33:22 debug: Polled...counter: 31, 27-06-2020 18:33:22 warn: Disconnected from cloud...relogin and init..., 27-06-2020 18:33:27 debug: Logged...Response code is 302: OK, 27-06-2020 18:33:37 debug: polling ..., 27-06-2020 18:33:47 debug: return null, overview empty!, 27-06-2020 18:33:47 debug: Polled...counter: 32, 27-06-2020 18:33:47 warn: Disconnected from cloud...relogin and init..., 27-06-2020 18:33:52 debug: Logged...Response code is 302: OK, 27-06-2020 18:33:57 debug: ...site and Pin Code sent...Response code is 302: OK, 27-06-2020 18:34:02 debug: polling ..., 27-06-2020 18:34:07 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:12 debug: return null, overview empty!, 27-06-2020 18:34:12 debug: Polled...counter: 33, 27-06-2020 18:34:19 debug: ...site and Pin Code sent...Response code is 302: OK, 27-06-2020 18:34:20 debug: ...Cameras taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:24 debug: ...Cameras taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:27 debug: polling ..., 27-06-2020 18:34:28 debug: ...Event History taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:29 debug: ...Event History taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:32 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:33 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:36 debug: ...Detectors taken...Response code is 200 and no data error: OK, 27-06-2020 18:34:37 debug: return null, overview empty!, 27-06-2020 18:34:37 debug: Polled...counter: 34, 27-06-2020 18:34:42 debug: return null, overview empty!, 27-06-2020 18:34:42 debug: newarmstatus emitted, 27-06-2020 18:34:42 info: Arming status: ["disarmed","partarmed","disarmed","disarmed"], 27-06-2020 18:34:42 debug: Init function for getting data from Cloud completed: OK, (node:1) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'LogRecords' of undefined, at RiscoPoller.riscoPoller.on (/app/app.js:111:54), at emitNone (events.js:106:13), at RiscoPoller.emit (events.js:208:7), at RiscoPoller.init (/app/panelPoller.js:34:10), at <anonymous>, at process._tickCallback (internal/process/next_tick.js:189:7), (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1), (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code., 27-06-2020 18:34:52 debug: polling ...,

from risco-mqtt-bridge.

lucacalcaterra avatar lucacalcaterra commented on June 11, 2024

fixed with @swiergot pr. I must test it and merge

from risco-mqtt-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.