maragelis / ParadoxRs232toMqtt

esp8266, serial bus to mqtt for Paradox alarm systems
MIT License
80 stars 22 forks source link

2 dead wemos #18

Closed peterkexas closed 5 years ago

peterkexas commented 5 years ago

Hi I am trying to connect wemos d1 mini to Paradox sp 5500 alarm panel to serial and they burn. What I am doing wrong?

cybertza commented 5 years ago

Are you using an voltage regulator on the power line?

Regards

Jaco Goussard

On 18 Dec 2018, at 20:05, Peter notifications@github.com wrote:

Hi I am trying to connect wemos d1 mini to Paradox sp 5500 alarm panel to serial and they burn. What I am doing wrong?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

peterkexas commented 5 years ago

I have 12v to 5v regulator with usb out for supply d1 mini

maragelis commented 5 years ago

can you upload a picture with the connections.

The sp5500 and 6000 serial connector is upside down acourding to the picture in the wiki. The RX/TX pins are on the top two pins. Pins top to bottom are RX-TX-Ground-12V

peterkexas commented 5 years ago

I am out right now but will see it tonight again with a multimeter.

peterkexas commented 5 years ago

Hello again! Happy New year!!!! I connect my wemos to my sp5500. I have a mqtt server running on my rpi setup with node red on home assistant but when I try to arm , disarm nothing happened. Eny help? Wemos flashed with bin file that I download from here. Thank you and sorry for my bad English!

maragelis commented 5 years ago

First check the mqtt topic that you are getting messages this can be done by either using node-red debug node or using an mqtt client. 1) after flashing did you change the mqtt server ? 2) are you getting connect message in mqtt status topic. 3) listen to mqtt # topic

I see you are Greek if you want send me private message I will give you my phone so I can help you

peterkexas commented 5 years ago

I have change the mqtt server and my wifi credentials. I am trying to debug with node red but nothing happened. I was trying with paradox/# topic and nothing again. Sorry I am very new to this.

maragelis commented 5 years ago

Try # or /#

peterkexas commented 5 years ago

I am trying to send you pm and i can not find it anyway. With /# in Nodered I get massages from paradox/in but nothing from paradox/out.

maragelis commented 5 years ago

Try changing serial lines rxtx you might have them the wrong way. Check debug messages on usb

peterkexas commented 5 years ago

I double check them panel rx to d1 tx , panel tx to d1 rx and ground. On serial monitor I can see that connects to wifi but nothing for mqtt server, is that right?

peterkexas commented 5 years ago

I check debug from nodered i see only /paradox/in and when restart my wemos i have this :

1/4/2019, 6:56:42 PMnode: 7cb71166.730df /paradox/status : msg.payload : string[17] "Paradox Connected"

1/4/2019, 6:56:44 PMnode: 7cb71166.730df /paradox/status : msg.payload : string[23] "ParadoxController V2.11" I download mqtt.fx and i have the same messages Have you any idea to help me? thank you!

maragelis commented 5 years ago

thats correct you are working fine, are you not getting events on paradox/out ?

peterkexas commented 5 years ago

No!! nothing.

maragelis commented 5 years ago

Try v2 bin files

peterkexas commented 5 years ago

I have to flash blank.bin file first or flash it directly?

maragelis commented 5 years ago

yes flash blank.bin

peterkexas commented 5 years ago

nothing again flash v2 bin connects to my mqtt broker and wifi network but i dont have any message to /paradox/out

maragelis commented 5 years ago

my friend, v2 is at paradoxCTL/# and rx/tx is on gpio 13/15

peterkexas commented 5 years ago

Sorry I am stupid. But trying with paradoxCTL/# and pins 13 15 again nothing. I am trying to copy your code for nodered and import to flow and has error so I can't importing it.

peterkexas commented 5 years ago

Thank you!! thank you !!! I have done it , managed to take messages from my panel on paradoxdCTL/out now another hard part to connect it with my home assistant via Nodered. Thanks again for your help!!

FigJam23 commented 5 years ago

Good job , I'm interested on your node red useage to intergrate home assistant and how that works. I've just changed some out put messages in code to remove all the " " symbols that home assistant has a hard time with example below

paradoxdCTL/out { armstatus:224, event:1, sub_event:1, dummy:Zone 01

This now works for armed disarmed zone open closes restors and all the other out messages I just use a simple motion binary_sensor With payload_on : And payload_off: In home assistant works a treat . But I'm still testing and need to verify this will not cause other issues .

code changes I am testing below

FROM
String retval = "{ \"armstatus\":" + String(armstatus) + ", \"event\":" + String(event) + ", \"sub_event\":" + String(sub_event) + ", \"dummy\":\"" + String(dummy) + "\"}";
TO
String retval = "{ armstatus\:" + String(armstatus) + ", event\:" + String(event) + ", \sub_event\:" + String(sub_event) + ", \dummy\:" + String(dummy) + "}";

HASS below binary_sensor:

peterkexas commented 5 years ago

Thank you, if you can send me your code to test it on my setup. You have to install nodered to machine runs home assistant and then install home assistant pallet and then connect them. An example for this on how it works we have here paradox232tomqtt on wiki-pages hassio home assistant section

FigJam23 commented 5 years ago

Not sure if you have seen but edited my post above with details 😉

maragelis commented 5 years ago

Now that I understand how hassio binary sensor works I will try get that into my code. Should be ready by this afternoon

FigJam23 commented 5 years ago

Cool the main prob that home assistant has with these json message Hass doesnt like more than two " " symbols anymore you have problems . Ive tryed templating to get things to work but ends up extramly complicated and unreliable. This way works very well and very simple solution .

Good luck

maragelis commented 5 years ago

reading the hassio binary sensor https://www.home-assistant.io/components/binary_sensor.mqtt/ you could use: value_template: '{{ value.x }}'

in the case of my project you would use value_template: '{{value_json.event}}' payload_on: "1" payload_off: "0"

FigJam23 commented 5 years ago

I personally had a hard time getting the template or value template to work with json but I'm no HASS expert either. It will definitely be a good addition for this project to support Hass as it's got a large community.

Slightly changing subject but I've been switching my comms between my MG5050 and Evo 48 panel unfortunately I get no message from the Evo board I'm assuming it's got a different bit rate or something different I do know the Evo uses 24 digit headers dose that sound like it's not compatible have you talked to anyone with success with the EVO systems thanks.

maragelis commented 5 years ago

Evo has different message dynamic from 20 to (i dont know)

FigJam23 commented 5 years ago

Ah ok ;( my fav Paradox Panels are the Evos but hay with some exspanders and a couple of TM70 Keypads I'll still be happy with the MG5050 I guess. Thanks for the info

maragelis commented 5 years ago

I have created my own tm70 keypads using this project and openhab/habpanel looks good and works great, and also intergrated lights and heating . Just used cheap arduino tablets (60euros)

FigJam23 commented 5 years ago

Omg that's just what I need dose it only work with openhab .. I guess you just make MQTT style key pad using a pi or similar that supports touch screens . Have you uploaded any photos and info on that project .. definitely interested that

maragelis commented 5 years ago

OK hassio is ready there will be new topics available 👍 paradoxdCTL/out/zoneX where x is zone number from 1-32 paradoxdCTL/out/zoneX has value ON and OFF paradoxdCTL/out/state has values: disarmed armed_home armed_away triggered

so in hassio

https://www.home-assistant.io/components/binary_sensor.mqtt/

binary_sensor:

also https://www.home-assistant.io/components/alarm_control_panel.mqtt/

alarm_control_panel:

maragelis commented 5 years ago

doing some testing and will upload dev branch in a minute

FigJam23 commented 5 years ago

Wow that was fast good job thanks very much

peterkexas commented 5 years ago

thanks you saved me!!!!

maragelis commented 5 years ago

Ok new release is up Hassio and updated test branch

maragelis commented 5 years ago

just to get the blood running

image

peterkexas commented 5 years ago

Hi!! Thanks very much ! V2 works like a charm. Trying to figure out what is the command_topic to change the state !. The sensors work's fine for me but I can't arm or disarm from hass

maragelis commented 5 years ago

Check the wiki hassio v2 you will get your answer

peterkexas commented 5 years ago

:( ?

maragelis commented 5 years ago

alarm_control_panel:

platform: mqtt state_topic: “paradoxdCTL/out/state” payload_disarm: ‘{"password":“0000”,“Command”:“disarm”,“Subcommand”:"0"}’ payload_arm_night: ‘{"password":“0000”,“Command”:“sleep”,“Subcommand”:"0"}’ payload_arm_home: ‘{"password":“0000”,“Command”:“stay”,“Subcommand”:"0"}’ payload_arm_away: ‘{"password":“0000”,“Command”:“arm”,“Subcommand”:"0"}’

change password to your pin code

peterkexas commented 5 years ago

I saw that and add it to my configuration and I have state of my alarm but i can't arm or disarm the system.I must add command_topic to configuration to control the alarm. Sorry for all that but I am trying to learn I have no idea about code and how works. Thanks again!!

maragelis commented 5 years ago

My friend command_topic is paradoxCTL/in

FigJam23 commented 5 years ago

Doesn't seem to matter what I do or what I try I can't arm disarm or any commands to panel via the paradoxdCTL/in . I'm not sure what else to try mqtt messages definitely being sent just no response from alarm . Just brought the TM70 keypad and if I arm disarm via the keypad I get all armed states back via mqtt so frustrated lol

FigJam23 commented 5 years ago

Also don't you mean the command topic is paradoxdCTL/in Not paradoxCTL/in

Also when sending arm or disarm commands I get returned command = 4 or 5 in serial mon

maragelis commented 5 years ago

check mqtt status if you are recieving "Problem connecting to panel" means your panel is not allowing login from software.

FigJam23 commented 5 years ago

Yip receiving very well I can connect with IP150 via same port so it's got to be something related to the wemos. maybe I'll try change some user codes but I don't feel it's likely the issue as I can arm disarm via keypad ip150 using same code

maragelis commented 5 years ago

are you disconnecting the ip150 . could you send all events recieved by mqtt when arming the system using the mqtt. I want to see if you are recieving the event 48 sub 02 thats the software login event

FigJam23 commented 5 years ago

I definitely have ip150 disconnect when wemos on I'm fairly sure I'm getting those codes but give me a min I'll go arm trigger entry delay siren and disarm past you the output soon