vanackej / risco-mqtt-local

Provide Risco alarm system integration to Home assistant using local TCP communication (no cloud required) and MQTT
MIT License
24 stars 11 forks source link

Add-on Socketmode: Proxy not trying to connect to cloud #40

Closed ekkesa closed 2 years ago

ekkesa commented 2 years ago

The config file has the necessary entries to run in Socketmode: proxy, but from the logs it seem to not even attempt to connect to cloud.

[services.d] starting services
[services.d] done.
Loading config from: /config/risco-mqtt.json
6/28/2022, 9:43:19 PM [info] autoConnect enabled, starting communication
6/28/2022, 9:43:19 PM [info] Connecting to mqtt server: mqtt://192.168.1.2:1883
6/28/2022, 9:43:20 PM [info] Connected on mqtt server: mqtt://192.168.1.2:1883
6/28/2022, 9:43:20 PM [info] Panel is not connected, waiting
6/28/2022, 9:43:20 PM [warn] Command[NaN] Wrong CRC value for the response.
6/28/2022, 9:43:21 PM [info] Panel info: LightSys/RP432, FW 6.07
6/28/2022, 9:43:21 PM [info] Panel options: 4 parts, 50 zones, 32 outputs, Pir Cam support: false
6/28/2022, 9:43:21 PM [info] Starting devices discovery
6/28/2022, 9:43:21 PM [info] Retrieving System Information
6/28/2022, 9:43:21 PM [info] Retrieving zones configuration
6/28/2022, 9:43:40 PM [info] Retrieving outputs configuration
6/28/2022, 9:43:45 PM [warn] Command[24] Receipt of an error code: Device Doesn't Exists
6/28/2022, 9:43:45 PM [warn] Got error while fetching output 23 data: N19
6/28/2022, 9:43:45 PM [info] Output 23 does not exists, stopping outputs discovery
6/28/2022, 9:43:45 PM [info] Retrieving partitions configuration
6/28/2022, 9:43:46 PM [info] Panel and MQTT communications are ready
6/28/2022, 9:43:47 PM [info] Publishing Home Assistant discovery info

Any assistance will be appreciated to get this running as intended. I have rebuild the add-on a few times, and cross checked my config against other forum users and it seems to be correct. I add my config below.

{
  "log": "info",
  "panel": {
    "panelIp": "192.168.1.4",
    "panelPort": 1000,
    "panelPassword": 5678,
    "panelId": "0001",
    "SocketMode": "proxy",
    "watchDogInterval": 10000,
    "DiscoverCode": true,
    "guessPasswordAndPanelId": false,
    "Disable_RiscoCloud": true,
    "Enable_RiscoCloud": true,
    "autoDiscover": false,
    "ListeningPort": 33000,
    "cloudUrl": "www.riscocloud.com",
    "cloudPort": 33000
  },
  "mqtt": {
    "url": "mqtt://192.168.1.2:1883",
    "username": "<redacted>",
    "password": "<redacted>"
  },
  "zones": {
    "default": {
      "off_delay": 0
    }
  }
}
markxroberts commented 2 years ago

I don't use this mode, so am just observing! You probably have tried this, but I'm wondering why both DIsable_RiscoCloud and Enable_RiscoCloud are set to true. My interpretation of the wiki is that only Enable_RiscoCLoud needs to be set to true.

ekkesa commented 2 years ago

Thx - I will try it again with Enable_RiscoCloud true again.

Initially, I had it in, then I saw in the documentation that the default is true, so I removed it. Then in one of the closed issues on the github repo - the solution was to add both. So I am just as confused - Which is strange is that it doesn't even try and fail, it is as if that part is just missing.

The reason why I would like to get the cloud up and running is firstly my wife still uses the Risco app occasionally, and secondly the push notifications on low battery etc.

Stupid question, but just to make sure - risco-lan-bridge form part of this add-on, I do not have to install it additionally. Just needs to be configured in the config?

Thank you!

markxroberts commented 2 years ago

In answer to your last question risco-lan-bridge is pulled as part of the docker image, so is built in to the add-on. If you've got any of it working, then risco-lan-bridge is responsible as risco-mqtt-local just interfaces the bridge to MQTT. It's a combined config file as some parameters are for -lan-bridge, and some for -mqtt-local. I'm working on integrating outputs in to the system at the moment. Hadn't thought about the other notifications. Do you want to think about some feature requests?

vanackej commented 2 years ago

Honestly, the Enable and Disable cloud options where in the original project I forked, but I never used those options, and I don't think they should be kept in the library itself, as they introduce a lot of confusion and complexity. People should enable/disable cloud directly on their alarm system depending on their wish.

vanackej commented 2 years ago

And about the proxy mode, I don't use it personnaly and I can't debug it because I don't have any cloud subscription anymore.

At least you should change log level to debug and provide those new logs, so that I could try to understand why it does not even attempt to connect to Risco cloud

ekkesa commented 2 years ago

I have uploaded my debug log here.

Do not hesitate should you require more information.

Thank you!

pergolafabio commented 2 years ago

For info, I use the proxy method since the beginning of this addon , and it works quite reliable, occasionally I need to restart the addon manually when there is network outage, the addon/service doesnt restart then

ekkesa commented 2 years ago

Not sure if this is till relevant? https://github.com/TJForc/risco-lan-bridge/issues/1#issuecomment-1108488513

ekkesa commented 2 years ago

Here is my config, perhaps there is an issue I am overlooking:

{ "log": "info", "panel": { "panelIp": "192.168.1.4", "panelPort": 1000, "panelPassword": 5678, "panelId": "0001", "autoConnect": true, "Enable_RiscoCloud": true, "SocketMode": "proxy", "ListeningPort": 33000, "CloudPort": 33000, "CloudUrl": "www.riscocloud.com", "watchDogInterval": 10000, "DiscoverCode": true, "guessPasswordAndPanelId": false, "autoDiscover": false, "ListeningPort": 33000, "cloudUrl": "www.riscocloud.com", "cloudPort": 33000 }, "mqtt": { "url": "mqtt://192.168.1.2:1883", "username": "<redacted>", "password": "<redacted>" }, "zones": { "default": { "off_delay": 0 } } }

ekkesa commented 2 years ago

I found it! A simple matter of case....

Had to change these two: "Enable_RiscoCloud": true, --> "Disable_RiscoCloud": true, "SocketMode": "proxy", --> "socketMode": "proxy",