ayasystems / powermaxesp8266 Goto Github PK
View Code? Open in Web Editor NEWPowerMax gateway ESP8266
License: GNU General Public License v3.0
PowerMax gateway ESP8266
License: GNU General Public License v3.0
Although the ESP syncs the time by NTP, the system time of the Powermax -panel isn't.
It would be nice if at any arbitrary moment, but at least once a day, the Powermax system time would be synced with the ESP time.
Maybe this could be done when any kind of event is fired.
As far as I can see the pmax lib has a function for setting the time.
I would try this myself, but I can't get the source compiled due to a lot of compiling errors.
I am now able to compile without errors, thanks to the latest change.
So am now trying to get the panel to sync with the ESP system time.
As far as I can see and understand (and that is very little), the time sync is part of this function in the PowerMaxAlarm lib:
//Should be called when panel is enrolled and entered download mode successfully
void PowerMaxAlarm::powerLinkEnrolled()
precondition is that the ESP has the system time already set.
This happens only when successfully logged on to an MQTT server, right?
So we have to wait for that.
And the panel should be in download mode.
What I want to try is to activate the time sync when the status of the panel changes to DISARMED.
That way I can test if the time is synced when the DISARM button is pushed in the web interface of the ESP.
To do this we have to add these calls to the onStatusChange() switch case? :
sendCommand(Pmax_DL_EXIT);
sendCommand(Pmax_DL_START);
powerLinkEnrolled();
sendCommand(Pmax_DL_EXIT);
But I have no idea if my thinking is correct.
(Not sure what the function os_getLocalTime() should do. I have set the return value to TRUE)
Anyways, I have a feeling you already tried to make the time sync working, but maybe with your knowledge we can give it another try to make it work? I can compile and test against a Powermax system.
stat_tamper is missing from the json in the mqtt powermax/zone messages.
eg:
{ "zoneId": 4, "zoneName": "Upstairs", "zoneType": 12, "zoneTypeStr": "Interior", "sensorId": 195, "sensorType": "Motion", "sensorMake": "Visonic PIR", "enrolled": true, "signalStrength": 3, "lastEvent": true, "lastEventTime": 12888, "stat_doorOpen": false, "stat_bypased": false, "stat_lowBattery": false, "stat_active": true }
It is also not present in the /log url:
{"zoneId":4,"zoneName":"Upstairs","zoneType":12,"zoneTypeStr":"Interior","sensorId":195,"sensorType":"Motion","sensorMake":"Visonic PIR","enrolled":true,"signalStrength":3,"lastEvent":false,"lastEventTime":0,"stat_doorOpen":false,"stat_bypased":false,"stat_lowBattery":false,"stat_active":true}
It is however there on the /status url 'enroled_zones' section:
{"zoneName":"Upstairs", "zoneType":12, "zoneTypeStr":"Interior", "sensorId":195, "sensorType":"Motion", "sensorMake":"Visonic PIR", "signalStrength":3, "lastEvent":5, "lastEventAge":881, "stat_doorOpen":false, "stat_bypased":false, "stat_lowBattery":false, "stat_active":true, "stat_tamper":false}
which comes from the PowerMax lib 'Zone::DumpToJson' method, not the mqtt.ino 'void publishAlarmZone(int ix)' method. So it is there on the zone object, but doesn't get pulled out by the mqtt publishAlarmZone method. I can see that the mqtt method does include the tamper alarm, and the json path looks correct, so I'm not sure why this is being left off...
doc["stat_tamper"] = alarmZone.stat.tamper;
mqtt packet size is 512:
MQTT_MAX_PACKET_SIZE: 512 (Need more of 256)
and the zone message is ~358 bytes, so that shouldn't be the problem.
Hello,
Is it possible to made an change button when you want to change settings like the mqtt server without flashing the esp board?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.