lyuzashi / mqtt-smarthome-system Goto Github PK
View Code? Open in Web Editor NEWApplication designed to run on a Raspberry Pi acting as a home automation Hub, supporting multiple protocols and management
Application designed to run on a Raspberry Pi acting as a home automation Hub, supporting multiple protocols and management
Wrap MIDI interface into a module which will occasionally/on trigger search for new matching devices and gracefully handle disconnects.
It should be able to detach and reconnect to devices when unplugged or plugged in and when config changes to specify new devices/config.
MQTT messages are all sent as strings.
Sensible assumptions could be made in this order
*/on
topic – boolean*/text
topic – stringParticular topics could have overriding rules for special cases.
Write a function to handle all these for unmarshalling a message.
Compose configuration into MQTT topics.
Requires handling of arrays and tool to rebuild config object in memory.
Discover tree structure by subscribing to a *
topic and getting all messages under it?
e.g.
interfaces:
lattice:
modes:
lighting:
zones:
- name: lounge
interfaces/lattice/modes/lighting/zones/0/name
: lounge
Interfaces should only be concerned with moving data in and out of MQTT messages.
Any translation can be handled by logic.
HAP would be a system-based protocol
If a device is offline and it's status is requested, the callback awaiting a response appears to prevent any other communication with other devices
Provide interface for devices via PiGPIO.
Rebuild local GPIO to connect via PiGPIO too.
Rather than the current setup which limits hue API calls to one in-flight at a time, use throttling to allow many requests up to a certain rate to be sent.
https://developers.meethue.com/develop/application-design-guidance/hue-system-performance/
The available system throughput (from the hue API) is thus restricted by the number of ZigBee messages per second that can be handled by the system, which is approximately 25 ZigBee messages/s
#ZigBee messages per hue API command | Parameters used in body of hue API command (example) | System throughput | Time between hue API messages |
---|---|---|---|
1 | setting brightness | brightness | 40 ms |
1 | setting brightness+color | 25 hue API commands/s | 80 ms |
3 | setting brightness + color+on | 2 hue API commands/s | 120 ms |
Parameters used in body of hue API command | #ZigBee messages |
---|---|
bri | 1 |
hue | 1 |
sat | 1 |
xy | 1 |
ct | 1 |
on | 1 |
transitiontime | 0 |
bri + xy | 2 |
bri + xy + on | 3 |
bri + hue | 2 |
bri + sat | 2 |
bri + hue + sat | 2 |
bri + hue + sat + on | 3 |
bri + ct | 2 |
bri + ct + on | 3 |
Configuration for scenes which may have names or be part of a sequence.
Sequencing provides time stamp sets of scenes and start from 0 when triggered
Simple web-based displays can stream in data
Provide authentication scheme for accessing MQTT topics
Simple IoT devices can provide a username:password and will have limited access to particular topics.
Access control can be described in #17
Every device should belong to an universal graph including protocol specific interfaces and generic attribute language.
This could be the presence of a device by MAC address on the IP network, a ZigBee lightbulb with all attributes and multiple protocol support or a local input device.
Provide some way to generate or template these so new devices can be added easily. A config screen?
As each message arrives, store it as "last state" which will enable handling controls such as rotary knobs and determining velocity
Simple discover/attach loop to find network devices and attach them via USB/IP when a remote computer is publishing an advertisement.
Provide status of banks and key presses over MQTT.
This can be used to display an interface for controlling in different modes, e.g. Lighting bank selected, show master brightness, channel names and modifier hints
While running long transitions, it should be possible to calculate the current state by extrapolating the less granular changes observed.
These should then have the capability to be overrode, such as turning off lights when leaving during a sunset event
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.