Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qolsys gateway not receiving sensor change states #133

Open
amogh79 opened this issue Nov 25, 2023 · 10 comments
Open

Qolsys gateway not receiving sensor change states #133

amogh79 opened this issue Nov 25, 2023 · 10 comments

Comments

@amogh79
Copy link

amogh79 commented Nov 25, 2023

Hi,

My qolysys gateway is not receiving sensor change states whenever the sensor state changes and is displayed on the panel. If I reboot the panel, then on panel startup I receive all the sensor states and other panel info. I checked this using a MQTT client listening to Homeassistant MQTT broker.

Any reason why I am not receiving the sensor change states.

Help will be much updated.

Thanks

@shivamchoudhary
Copy link

Would you be able to run the below snippet from your local network by adapting the Qolsys Parameters and check if you get the INFO messages when the sensor changes states ?

#!/usr/bin/python3

import json
import socket
import ssl
import sys
import time


# Qolsys Parameters
qolsysPanel     = "your_panel_ip"
qolsysPort      = yourport 
qolsysToken     = "yourtoken"
qolsysTimeout   = 20


################################################################################
# Code

statusString    = {
                    "nonce":        "test",
                    "action":       "INFO",
                    "info_type":    "SUMMARY",
                    "version":      0,
                    "source":       "C4",
                    "token":        qolsysToken,
                }

def main():
    try:
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.settimeout(qolsysTimeout)
    except socket.error:
        print('Could not create a socket')
        sys.exit()

    # Wrap SSL
    wrappedSocket = ssl.wrap_socket(sock, cert_reqs=ssl.CERT_NONE, ssl_version=ssl.PROTOCOL_TLSv1_2)

    # Connect to server
    try:
        wrappedSocket.connect((qolsysPanel, qolsysPort))
    except socket.error:
        print('Could not connect to server')
        sys.exit()
    
    # Send message and print reply
    online = True
    while online:
        wrappedSocket.send((json.dumps(statusString)).encode())
        while True:
            response = wrappedSocket.recv(4096).decode()
            if is_json(response):
                print(response)
            break  # stop receiving
        time.sleep(qolsysTimeout / 4)

def is_json(myjson):
    try:
        json_object = json.loads(myjson)
    except ValueError as e:
        return False
    return True

# Start client
main()

@amogh79
Copy link
Author

amogh79 commented Jan 4, 2024

I get status messages for all the sensors. When I open one of the sensor I get ZONE_EVENT stating the sensor is open. Its kinda weird that it shows the ZONE_EVENT = open then closed then again open wherein the sensor is always open and no changes are done to the sensor state. The status of all the sensors also gets updated with that particular sensor showing it open.

Do you have code snippet and the actual command to arm and disarm? I would like to try that from the code. Those actions dont work from my home assistant either.

@kg5iru
Copy link

kg5iru commented Jan 4, 2024

I have the same issue but haven't had time to sit down and look at it.

My system also appears to send [Zone_Event = open] when the sensor is open and [Zone_Event = closed] when closed to MQTT.

@amogh79
Copy link
Author

amogh79 commented Jan 4, 2024

I also observed that after I close the sensor it still send the status in json as open. Its been 5 minutes now and it still shows it as open.

@amogh79
Copy link
Author

amogh79 commented Jan 4, 2024

@kg5iru Does the sensor state change in home assistant UI for you? For me it doesn't change.

@kg5iru
Copy link

kg5iru commented Jan 4, 2024

The only changes I get are back and forth from unavailable to closed when I'm restarting AppDaemon when I thought something was wrong with my config and started over.

@amogh79
Copy link
Author

amogh79 commented Jan 4, 2024

The only changes I get are back and forth from unavailable to closed when I'm restarting AppDaemon when I thought something was wrong with my config and started over.

I have the same issue I only get sensor states on startup and never after that.

@kg5iru
Copy link

kg5iru commented Jan 4, 2024

That is exactly what I have going on. Homeassistant only show the initial change from unavailable to closed. Homeassistant only ever changes back to unavailable (after stopping appdaemon) after that.

MQTT Zone_Event does show the correct status of the sensors.

@XaF
Copy link
Owner

XaF commented Jan 4, 2024

What hardware and software versions of the qolsys panel are you using?

@kg5iru
Copy link

kg5iru commented Jan 10, 2024

What hardware and software versions of the qolsys panel are you using?

IQPanel4
Model: IQP4006
HW Version: Rev 1

SW Version: 4.3.0-ADCS 10.9.2
Last Software Version Upgrade: 4.3.0.20230417.rc2183_full_upgrade_generic.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants