trunk
HeNine 3 years ago
commit 2a2067b611

4
.gitignore vendored

@ -0,0 +1,4 @@
doc
.venv
schemata
mdbook.exe

@ -0,0 +1,9 @@
[book]
authors = ["henine"]
language = "en"
description = "picc documentation, design document and schemata."
multilingual = false
src = "doc_src"
[build]
build-dir = "doc"

@ -0,0 +1,2 @@
jsonnet -J ./lib -S -c -m . .\src\docs.jsonnet
jsonnet -J ./lib -c -m . .\src\schemata.jsonnet

@ -0,0 +1,173 @@
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
### Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
* __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors).
* __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensors permission is not necessary for any reasonfor example, because of any applicable exception or limitation to copyrightthen that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees).
## Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
### Section 1 Definitions.
a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. __BY-NC-SA Compatible License__ means a license listed at [creativecommons.org/compatiblelicenses](http://creativecommons.org/compatiblelicenses), approved by Creative Commons as essentially the equivalent of this Public License.
d. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
g. __License Elements__ means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.
h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
j. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License.
k. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
l. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
m. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
n. __You__ means the individual or entity exercising the Licensed Rights under this Public License. __Your__ has a corresponding meaning.
### Section 2 Scope.
a. ___License grant.___
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. __Term.__ The term of this Public License is specified in Section 6(a).
4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. __Downstream recipients.__
A. __Offer from the Licensor Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. __Additional offer from the Licensor Adapted Material.__ Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapters License You apply.
C. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. ___Other rights.___
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
### Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. ___Attribution.___
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
b. ___ShareAlike.___
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
1. The Adapters License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
### Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
### Section 5 Disclaimer of Warranties and Limitation of Liability.
a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__
b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
### Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
### Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
### Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
> Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
>
> Creative Commons may be contacted at creativecommons.org

@ -0,0 +1,21 @@
# Summary
- [Introduction](./introduction.md)
- [picc Stream Tree](./tree.md)
- [picc Components](./components.md)
- [Locations](./components/locations.md)
- [Drivers](./components/drivers.md)
- [Transformers](./transformers.md)
- [Relationships](./relationships.md)
- [Reference]()
- [Entity](./reference/v0.1-dev/entity.md)
- [Room](./reference/v0.1-dev/room.md)
- [Relationship](./reference/v0.1-dev/relationship.md)
- [Devices]()
- [Light](./reference/v0.1-dev/devices/light.md)
- [Sensor](./reference/v0.1-dev/devices/sensor.md)
---
[License](./LICENSE.md)

@ -0,0 +1,7 @@
# picc Components
## Entities
## Drivers
## Relationships

@ -0,0 +1,64 @@
# picc Drivers
Drivers supply data to streams under `app.picc.<domain>.dev.*`
- Lights
- Sensors
## Light
`app.picc.<domain>.dev.lights.light_<id>`
### Attributes
- **is_on**
- `boolean`
- Whether light is shining or not (Note: This is distinct from the power status of the controller.)
- **brightness**
- `float: [0, 1]`
- Brightness according to device's definition 0 being dimmest, 1 being brightest.
- power
- `float: [0, inf)`, optional
- Power usage in watts.
- temperature
- `int: [0, inf)`, optional
- Color temperature in kelvin.
- color
- `[float: [0, 1], float: [0, 1], float[0, 1]]`, optional
- List of RGB color values in device's own color space.
- battery
- `float: [0, 1]`, optional
- Battery status 0 being empty battery and 1 being full, as defined by the device.
### Methods
- *TODO*
## Sensor
`app.picc.<domain>.dev.sensors.sensor_<id>`
### Attributes
- temperature
- `float: [273.15, inf)`, optional
- Temperature measurement in Celsius.
- humidity
- `float: [0, 1]`, optional
- Humidity percentage measurement
- pressure
- `float: [0, inf)`, optional
- wind
- `[float: [0, 360), float: [0, inf)]`, optional
- Wind measurement with direction in degrees and speed in km/h.
- precipitation
- battery
- `float: [0, 1]`, optional
- Battery status 0 being empty battery and 1 being full, as defined by the device.
- **is_valid**
- `boolean`
- Whether the current value is valid.
### Methods
- *TODO*

@ -0,0 +1,7 @@
# Locations
## Site
## Building
## Room

@ -0,0 +1 @@
# Drivers

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="120"
height="42"
id="svg2759"
sodipodi:version="0.32"
inkscape:version="0.45+devel"
version="1.0"
sodipodi:docname="by-nc-sa.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs2761" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#8b8b8b"
borderopacity="1"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.8760684"
inkscape:cx="60"
inkscape:cy="31"
inkscape:document-units="px"
inkscape:current-layer="layer1"
width="120px"
height="42px"
inkscape:showpageshadow="false"
inkscape:window-width="1198"
inkscape:window-height="624"
inkscape:window-x="170"
inkscape:window-y="319" />
<metadata
id="metadata2764">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g2630">
<path
id="path3817_5_"
nodetypes="ccccccc"
d="M 3.4083297,0.45268464 L 116.76243,0.65404185 C 118.34626,0.65404185 119.76124,0.41920791 119.76124,3.814567 L 119.62246,41.143644 L 0.54733418,41.143644 L 0.54733418,3.675801 C 0.54733418,2.0014081 0.70939995,0.45268464 3.4083297,0.45268464 z"
style="fill:#aab2ab" />
<path
d="M 117.7533,-1.417352e-06 L 2.2476335,-1.417352e-06 C 1.0083193,-1.417352e-06 -2.0408688e-05,1.0082254 -2.0408688e-05,2.2469141 L -2.0408688e-05,41.492978 C -2.0408688e-05,41.772935 0.22707838,41.999998 0.5075432,41.999998 L 119.49241,41.999998 C 119.77289,41.999998 119.99998,41.772925 119.99998,41.492978 L 119.99998,2.2469141 C 119.99998,1.0082254 118.99164,-1.417352e-06 117.7533,-1.417352e-06 z M 2.2476335,1.0150221 L 117.75331,1.0150221 C 118.43264,1.0150221 118.98486,1.5676515 118.98486,2.246924 C 118.98486,2.246924 118.98486,18.04326 118.98486,29.467549 L 36.428267,29.467549 C 33.402284,34.938555 27.571583,38.65317 20.881033,38.65317 C 14.188536,38.65317 8.3597829,34.941953 5.3357378,29.467549 L 1.0151167,29.467549 C 1.0151167,18.04326 1.0151167,2.246924 1.0151167,2.246924 C 1.0151068,1.5676515 1.5682849,1.0150221 2.2476335,1.0150221 z"
id="path120" />
<g
id="g5908_5_"
transform="matrix(0.8674921,0,0,0.8673951,-387.30972,67.870882)">
<path
id="path5906_5_"
cx="296.35416"
ry="22.939548"
cy="264.3577"
type="arc"
rx="22.939548"
d="M 486.26599,-55.7066 C 486.27154,-47.02581 479.2381,-39.9851 470.55786,-39.97952 C 461.87768,-39.9739 454.83636,-47.00738 454.83081,-55.68762 C 454.83081,-55.69433 454.83081,-55.69989 454.83081,-55.7066 C 454.82519,-64.38739 461.85864,-71.4281 470.53888,-71.43371 C 479.22022,-71.43871 486.26148,-64.40588 486.26599,-55.72564 C 486.26599,-55.71948 486.26599,-55.71277 486.26599,-55.7066 z"
style="fill:#ffffff" />
<g
id="g5706_5_"
transform="translate(-289.6157,99.0653)">
<path
id="path5708_5_"
d="M 772.94165,-167.5741 C 776.42651,-164.08869 778.16943,-159.82074 778.16943,-154.77191 C 778.16943,-149.72253 776.45666,-145.49988 773.03112,-142.10397 C 769.39526,-138.52795 765.09936,-136.74023 760.14111,-136.74023 C 755.24328,-136.74023 751.02124,-138.51287 747.47717,-142.05978 C 743.93078,-145.60504 742.15869,-149.84222 742.15869,-154.77191 C 742.15869,-159.7005 743.93078,-163.96789 747.47717,-167.5741 C 750.93176,-171.06061 755.15381,-172.80359 760.14111,-172.80359 C 765.18994,-172.80359 769.45569,-171.06061 772.94165,-167.5741 z M 749.82312,-165.22925 C 746.87634,-162.25287 745.40295,-158.76636 745.40295,-154.76746 C 745.40295,-150.76856 746.86181,-147.31165 749.77722,-144.39624 C 752.69482,-141.47974 756.16626,-140.02148 760.19482,-140.02148 C 764.22338,-140.02148 767.72497,-141.49429 770.7019,-144.44043 C 773.52783,-147.17688 774.94079,-150.6181 774.94079,-154.76746 C 774.94079,-158.88495 773.50439,-162.38038 770.63256,-165.25165 C 767.76195,-168.12226 764.28271,-169.55817 760.19482,-169.55817 C 756.10693,-169.55817 752.64783,-168.11499 749.82312,-165.22925 z M 757.57703,-156.52606 C 757.12732,-157.50775 756.45386,-157.9989 755.55432,-157.9989 C 753.9657,-157.9989 753.17139,-156.92883 753.17139,-154.78979 C 753.17139,-152.65026 753.9657,-151.58129 755.55432,-151.58129 C 756.60376,-151.58129 757.35327,-152.10204 757.80298,-153.14587 L 760.00574,-151.97284 C 758.95532,-150.10736 757.38013,-149.17383 755.28028,-149.17383 C 753.66028,-149.17383 752.36256,-149.67053 751.38819,-150.66339 C 750.41273,-151.6568 749.92493,-153.02673 749.92493,-154.77191 C 749.92493,-156.48694 750.42835,-157.84845 751.43299,-158.85693 C 752.43751,-159.86547 753.69056,-160.3695 755.1908,-160.3695 C 757.41138,-160.3695 759,-159.49462 759.96216,-157.74664 L 757.57703,-156.52606 z M 767.94092,-156.52606 C 767.49011,-157.50775 766.82886,-157.9989 765.9585,-157.9989 C 764.33753,-157.9989 763.52637,-156.92883 763.52637,-154.78979 C 763.52637,-152.65026 764.33753,-151.58129 765.9585,-151.58129 C 767.01014,-151.58129 767.74622,-152.10204 768.16578,-153.14587 L 770.41773,-151.97284 C 769.36951,-150.10736 767.79664,-149.17383 765.70008,-149.17383 C 764.0824,-149.17383 762.78809,-149.67053 761.81361,-150.66339 C 760.84144,-151.6568 760.35365,-153.02673 760.35365,-154.77191 C 760.35365,-156.48694 760.84816,-157.84845 761.83717,-158.85693 C 762.82496,-159.86547 764.08241,-160.3695 765.61061,-160.3695 C 767.8268,-160.3695 769.41432,-159.49462 770.37196,-157.74664 L 767.94092,-156.52606 z" />
</g>
</g>
<g
transform="matrix(0.9937808,0,0,0.9936696,-437.12334,-74.436914)"
id="g126">
<circle
cx="491.94629"
cy="90.231934"
r="10.80615"
id="circle128"
sodipodi:cx="491.94629"
sodipodi:cy="90.231934"
sodipodi:rx="10.80615"
sodipodi:ry="10.80615"
style="fill:#ffffff" />
<g
id="g130">
<path
d="M 495.07373,87.10498 C 495.07373,86.68848 494.73584,86.35107 494.31982,86.35107 L 489.54736,86.35107 C 489.13134,86.35107 488.79345,86.68847 488.79345,87.10498 L 488.79345,91.87793 L 490.1245,91.87793 L 490.1245,97.52979 L 493.74169,97.52979 L 493.74169,91.87793 L 495.07372,91.87793 L 495.07372,87.10498 L 495.07373,87.10498 z"
id="path132" />
<circle
cx="491.93359"
cy="84.090332"
r="1.63232"
id="circle134"
sodipodi:cx="491.93359"
sodipodi:cy="84.090332"
sodipodi:rx="1.63232"
sodipodi:ry="1.63232" />
</g>
<path
clip-rule="evenodd"
d="M 491.91846,78.3252 C 488.68701,78.3252 485.95069,79.45313 483.71143,81.70899 C 481.41358,84.04249 480.26514,86.80469 480.26514,89.99366 C 480.26514,93.18263 481.41358,95.9253 483.71143,98.22071 C 486.00928,100.51466 488.74561,101.6626 491.91846,101.6626 C 495.13135,101.6626 497.91651,100.50586 500.27295,98.19092 C 502.49268,95.99365 503.60205,93.26123 503.60205,89.99365 C 503.60205,86.72607 502.47314,83.96484 500.21435,81.70898 C 497.95556,79.45312 495.19092,78.3252 491.91846,78.3252 z M 491.94873,80.4248 C 494.59717,80.4248 496.84521,81.35888 498.69482,83.22607 C 500.56494,85.07324 501.49951,87.32959 501.49951,89.99365 C 501.49951,92.67724 500.58447,94.90429 498.75342,96.67431 C 496.82569,98.58007 494.55713,99.53271 491.94873,99.53271 C 489.33838,99.53271 487.08935,98.58984 485.20068,96.70312 C 483.31201,94.81689 482.36767,92.58056 482.36767,89.99365 C 482.36767,87.40674 483.32177,85.15136 485.22997,83.22607 C 487.06104,81.35889 489.30029,80.4248 491.94873,80.4248 z"
id="path136"
style="fill-rule:evenodd" />
</g>
<g
transform="matrix(0.9937808,0,0,0.9936696,-437.12334,-74.436914)"
enable-background="new "
id="g138">
<path
d="M 488.56299,107.86719 C 488.88037,107.86719 489.17041,107.89551 489.43213,107.95117 C 489.69385,108.00683 489.91846,108.09863 490.10596,108.22656 C 490.29248,108.35351 490.43701,108.52344 490.54053,108.73437 C 490.64307,108.94628 490.69483,109.20703 490.69483,109.51855 C 490.69483,109.85449 490.61866,110.13378 490.46534,110.35742 C 490.313,110.58203 490.08643,110.76465 489.78761,110.9082 C 490.19972,111.02636 490.50734,111.2334 490.71046,111.52929 C 490.91358,111.82518 491.01515,112.18163 491.01515,112.59863 C 491.01515,112.93457 490.94972,113.22558 490.81886,113.47168 C 490.688,113.7168 490.51124,113.91797 490.28956,114.07324 C 490.06886,114.22949 489.81593,114.34472 489.53272,114.41894 C 489.24854,114.49414 488.95752,114.53124 488.65772,114.53124 L 485.42139,114.53124 L 485.42139,107.86718 L 488.56299,107.86718 L 488.56299,107.86719 z M 488.37549,110.5625 C 488.63721,110.5625 488.85205,110.5 489.02002,110.37598 C 489.18897,110.25196 489.27295,110.05078 489.27295,109.77149 C 489.27295,109.61622 489.24463,109.48829 489.18897,109.38965 C 489.13233,109.29004 489.05811,109.21289 488.96436,109.15625 C 488.87061,109.10059 488.76319,109.06152 488.64209,109.04004 C 488.52002,109.01856 488.39404,109.00781 488.26318,109.00781 L 486.89013,109.00781 L 486.89013,110.5625 L 488.37549,110.5625 z M 488.46143,113.39062 C 488.60498,113.39062 488.7417,113.37695 488.87256,113.34863 C 489.00342,113.32031 489.11865,113.27343 489.21924,113.20898 C 489.31885,113.14355 489.39795,113.05468 489.45752,112.94238 C 489.51611,112.83105 489.54639,112.6875 489.54639,112.51367 C 489.54639,112.17187 489.44971,111.92773 489.25635,111.78125 C 489.06299,111.63574 488.80713,111.5625 488.48975,111.5625 L 486.89014,111.5625 L 486.89014,113.39062 L 488.46143,113.39062 z"
id="path140"
style="fill:#ffffff" />
<path
d="M 491.27393,107.86719 L 492.91651,107.86719 L 494.47706,110.49903 L 496.02882,107.86719 L 497.66261,107.86719 L 495.188,111.97364 L 495.188,114.53126 L 493.71925,114.53126 L 493.71925,111.93653 L 491.27393,107.86719 z"
id="path142"
style="fill:#ffffff" />
</g>
<g
transform="matrix(0.9937808,0,0,0.9936696,-437.12334,-74.436914)"
enable-background="new "
id="g144">
<path
d="M 538.91553,112.88379 C 538.99658,113.03906 539.10303,113.16504 539.23682,113.26172 C 539.37061,113.3584 539.52686,113.42969 539.70752,113.47656 C 539.88721,113.52344 540.07275,113.54687 540.26611,113.54687 C 540.39599,113.54687 540.53564,113.53613 540.68506,113.51367 C 540.8335,113.49219 540.97315,113.45019 541.10401,113.38769 C 541.23389,113.32617 541.34229,113.24023 541.43018,113.13085 C 541.51612,113.02245 541.56006,112.88378 541.56006,112.71581 C 541.56006,112.53515 541.50244,112.38964 541.38721,112.27733 C 541.27295,112.16503 541.12159,112.07225 540.93604,111.99706 C 540.74952,111.92284 540.5376,111.85741 540.30225,111.80077 C 540.06592,111.74511 539.82666,111.68261 539.58448,111.61425 C 539.33546,111.55175 539.09327,111.47558 538.85694,111.38573 C 538.62159,111.29589 538.40967,111.1787 538.22315,111.03514 C 538.0376,110.89256 537.88624,110.71385 537.77198,110.49901 C 537.65675,110.28417 537.59913,110.0244 537.59913,109.71971 C 537.59913,109.37694 537.67237,109.08006 537.81788,108.82811 C 537.96436,108.57616 538.15577,108.3662 538.39112,108.19725 C 538.62745,108.02928 538.89503,107.90526 539.19385,107.8242 C 539.4917,107.74315 539.79053,107.70311 540.08838,107.70311 C 540.43701,107.70311 540.771,107.74217 541.09131,107.8203 C 541.41065,107.89745 541.6958,108.0244 541.94385,108.19823 C 542.19287,108.37303 542.39014,108.59569 542.53662,108.8662 C 542.68213,109.13768 542.75537,109.46581 542.75537,109.85155 L 541.33349,109.85155 C 541.32079,109.65233 541.27978,109.48729 541.20849,109.35741 C 541.1372,109.22655 541.04247,109.12401 540.92431,109.04882 C 540.80712,108.9746 540.67236,108.92089 540.52099,108.89062 C 540.36962,108.85937 540.20361,108.84374 540.02392,108.84374 C 539.90673,108.84374 539.78857,108.85644 539.67138,108.88085 C 539.55322,108.90624 539.44677,108.94921 539.35107,109.01171 C 539.25439,109.07421 539.17627,109.15136 539.11377,109.24511 C 539.05225,109.33886 539.021,109.45702 539.021,109.5996 C 539.021,109.73046 539.04541,109.8369 539.09522,109.91698 C 539.14502,109.99803 539.24268,110.07323 539.38917,110.14159 C 539.53566,110.20995 539.73683,110.27831 539.99464,110.34667 C 540.25245,110.41503 540.59034,110.50292 541.00636,110.60839 C 541.13038,110.6328 541.30324,110.6787 541.52296,110.74413 C 541.74366,110.80956 541.96339,110.91308 542.18019,111.05663 C 542.39796,111.20018 542.58546,111.39159 542.74464,111.63085 C 542.90284,111.87011 542.98194,112.17675 542.98194,112.55077 C 542.98194,112.85546 542.92237,113.13866 542.80421,113.40038 C 542.68605,113.6621 542.51026,113.88768 542.27687,114.07714 C 542.04347,114.26757 541.75441,114.41503 541.40871,114.5205 C 541.06398,114.62695 540.66457,114.67968 540.20949,114.67968 C 539.8423,114.67968 539.48683,114.63378 539.14113,114.54394 C 538.79543,114.45312 538.49074,114.31152 538.22707,114.11816 C 537.96242,113.9248 537.75246,113.67773 537.59621,113.3789 C 537.44094,113.08007 537.36574,112.72558 537.37258,112.31445 L 538.79446,112.31445 C 538.79443,112.53809 538.83447,112.72852 538.91553,112.88379 z"
id="path146"
style="fill:#ffffff" />
<path
d="M 547.17236,107.86719 L 549.66455,114.53125 L 548.14307,114.53125 L 547.63916,113.04687 L 545.14697,113.04687 L 544.62353,114.53125 L 543.14892,114.53125 L 545.66943,107.86719 L 547.17236,107.86719 z M 547.25635,111.95312 L 546.41651,109.50976 L 546.39698,109.50976 L 545.52979,111.95312 L 547.25635,111.95312 z"
id="path148"
style="fill:#ffffff" />
</g>
<g
transform="matrix(0.9937808,0,0,0.9936696,-437.12334,-74.436914)"
enable-background="new "
id="g150">
<path
d="M 512.83057,107.86719 L 515.61475,112.33789 L 515.63037,112.33789 L 515.63037,107.86719 L 517.00537,107.86719 L 517.00537,114.53125 L 515.53955,114.53125 L 512.76611,110.06934 L 512.74756,110.06934 L 512.74756,114.53125 L 511.37256,114.53125 L 511.37256,107.86719 L 512.83057,107.86719 z"
id="path152"
style="fill:#ffffff" />
<path
d="M 522.56885,109.64258 C 522.48194,109.50196 522.37256,109.37891 522.2417,109.27344 C 522.11084,109.16797 521.96338,109.08496 521.79834,109.02637 C 521.6333,108.9668 521.46045,108.9375 521.28076,108.9375 C 520.95068,108.9375 520.67041,109.00098 520.43994,109.12891 C 520.20947,109.25586 520.02295,109.42676 519.88037,109.64161 C 519.73682,109.85645 519.63232,110.10059 519.56689,110.37403 C 519.50146,110.64747 519.46923,110.93067 519.46923,111.22266 C 519.46923,111.50293 519.50146,111.77539 519.56689,112.03907 C 519.63232,112.30372 519.73681,112.542 519.88037,112.75294 C 520.02295,112.96485 520.20947,113.1338 520.43994,113.26173 C 520.67041,113.38966 520.95068,113.45314 521.28076,113.45314 C 521.72803,113.45314 522.07861,113.31642 522.33056,113.04201 C 522.58251,112.76857 522.73681,112.40724 522.79247,111.959 L 524.21142,111.959 C 524.17431,112.37599 524.07763,112.75295 523.92236,113.08888 C 523.76709,113.42579 523.56103,113.71193 523.30615,113.94923 C 523.05127,114.18653 522.75244,114.3672 522.40967,114.4922 C 522.06787,114.6172 521.69092,114.6797 521.28076,114.6797 C 520.77002,114.6797 520.31103,114.59083 519.90283,114.4131 C 519.4956,114.23634 519.15088,113.99122 518.8706,113.68068 C 518.59033,113.36916 518.37451,113.00295 518.22509,112.58302 C 518.07568,112.16212 518.00048,111.70997 518.00048,111.22364 C 518.00048,110.72559 518.07568,110.26368 518.22509,109.83692 C 518.3745,109.41016 518.59032,109.03809 518.8706,108.72071 C 519.15088,108.40333 519.4956,108.1543 519.90283,107.97364 C 520.31103,107.79298 520.77002,107.70313 521.28076,107.70313 C 521.64795,107.70313 521.99463,107.75586 522.3208,107.86231 C 522.64795,107.96778 522.94092,108.12208 523.19873,108.3252 C 523.45752,108.52735 523.67041,108.77832 523.83838,109.07715 C 524.00635,109.37598 524.11182,109.71875 524.15576,110.10449 L 522.73681,110.10449 C 522.71143,109.93652 522.65576,109.78223 522.56885,109.64258 z"
id="path154"
style="fill:#ffffff" />
</g>
<g
id="g6332_1_"
transform="matrix(0.621108,0,0,0.6210385,-285.77182,240.48957)">
<path
id="path6334_1_"
cx="475.97119"
ry="29.209877"
cy="252.08646"
type="arc"
rx="29.209877"
d="M 644.57642,-363.11569 C 644.58423,-353.70389 636.95911,-346.0679 627.54663,-346.06088 C 618.13403,-346.05539 610.49963,-353.67813 610.4917,-363.09225 C 610.4917,-363.09927 610.4917,-363.10867 610.4917,-363.11569 C 610.48547,-372.52749 618.1106,-380.16348 627.52161,-380.1705 C 636.93421,-380.17752 644.56861,-372.55246 644.57642,-363.14145 C 644.57642,-363.13211 644.57642,-363.12509 644.57642,-363.11569 z"
style="fill:#ffffff" />
<g
id="g6336_1_"
transform="translate(-23.9521,-89.72962)">
<path
id="path6338_1_"
d="M 651.36426,-292.05655 C 646.19238,-292.05655 641.81421,-290.25107 638.23291,-286.64322 C 634.5564,-282.90878 632.71729,-278.48923 632.71729,-273.38608 C 632.71729,-268.28293 634.5564,-263.89615 638.23291,-260.22348 C 641.90796,-256.55154 646.28613,-254.71561 651.36426,-254.71561 C 656.50501,-254.71561 660.95972,-256.56797 664.72998,-260.26957 C 668.28162,-263.78678 670.05823,-268.15873 670.05823,-273.38609 C 670.05823,-278.61351 668.25196,-283.03306 664.63623,-286.64323 C 661.02222,-290.25107 656.59875,-292.05655 651.36426,-292.05655 z M 651.41113,-288.69559 C 655.64868,-288.69559 659.2456,-287.20261 662.20654,-284.21427 C 665.19726,-281.25883 666.6925,-277.65098 666.6925,-273.38608 C 666.6925,-269.09232 665.22851,-265.52976 662.2987,-262.69614 C 659.21594,-259.64768 655.58459,-258.12345 651.41113,-258.12345 C 647.23608,-258.12345 643.63769,-259.63285 640.61572,-262.65085 C 637.59387,-265.66959 636.08288,-269.24698 636.08288,-273.38608 C 636.08288,-277.52518 637.6079,-281.13455 640.66259,-284.21427 C 643.59082,-287.20261 647.17358,-288.69559 651.41113,-288.69559 z" />
<path
id="path6340_1_"
d="M 643.08923,-276.02048 C 643.833,-280.71897 647.13928,-283.22989 651.28466,-283.22989 C 657.24401,-283.22989 660.87682,-278.90488 660.87682,-273.13767 C 660.87682,-267.5095 657.01122,-263.13913 651.19078,-263.13913 C 647.18614,-263.13913 643.6002,-265.60245 642.94859,-270.43997 L 647.65171,-270.43997 C 647.79233,-267.92898 649.4221,-267.04465 651.75022,-267.04465 C 654.40342,-267.04465 656.12681,-269.50949 656.12681,-273.27671 C 656.12681,-277.23142 654.6378,-279.32285 651.84239,-279.32285 C 649.79393,-279.32285 648.02513,-278.57834 647.65172,-276.02048 L 649.01891,-276.02988 L 645.31737,-272.32669 L 641.61571,-276.02988 L 643.08923,-276.02048 z" />
</g>
</g>
<g
transform="translate(4.972327e-4,9.6235539e-3)"
id="g2366">
<path
id="path6372_1_"
cx="475.97119"
ry="29.209877"
cy="252.08646"
type="arc"
rx="29.209877"
d="M 87.801399,14.981221 C 87.806231,20.481808 83.349796,24.943138 77.848148,24.947525 C 72.347434,24.950898 67.885163,20.495415 67.8813,14.995762 C 67.8813,14.989951 67.8813,14.985575 67.8813,14.981221 C 67.877402,9.4801445 72.333872,5.0188155 77.834551,5.0144396 C 83.335231,5.0110323 87.797501,9.4665495 87.801399,14.966168 C 87.801399,14.971034 87.801399,14.976356 87.801399,14.981221 z"
style="fill:#ffffff" />
<path
id="path45"
d="M 86.070369,6.7455646 C 83.825249,4.5032726 81.077589,3.3828326 77.826689,3.3828326 C 74.614009,3.3828326 71.895369,4.5032726 69.670069,6.7455646 C 67.386019,9.0650066 66.245049,11.809127 66.245049,14.979335 C 66.245049,18.148837 67.386019,20.874555 69.670069,23.154358 C 71.953409,25.435578 74.672049,26.575837 77.826689,26.575837 C 81.019549,26.575837 83.787019,25.425671 86.128399,23.126048 C 88.334599,20.941796 89.438049,18.22599 89.438049,14.979335 C 89.438049,11.731974 88.315489,8.9871466 86.070369,6.7455646 z M 84.618679,21.618445 C 82.702679,23.512501 80.448359,24.458823 77.855709,24.458823 C 75.262349,24.458823 73.027129,23.521703 71.150059,21.646755 C 69.272989,19.771807 68.334459,17.549334 68.334459,14.979332 C 68.334459,13.89216 68.506099,12.864441 68.845489,11.89547 L 71.918369,13.255497 L 71.696829,13.255497 L 71.696829,14.633571 L 72.784359,14.633571 C 72.784359,14.828215 72.764899,15.022152 72.764899,15.216085 L 72.764899,15.546625 L 71.696829,15.546625 L 71.696829,16.924699 L 72.958829,16.924699 C 73.133649,17.953831 73.521879,18.788322 74.045999,19.448692 C 75.133169,20.885513 76.880359,21.661964 78.782919,21.661964 C 80.025799,21.661964 81.151199,21.293203 81.811569,20.923735 L 81.345129,18.76921 C 80.937439,18.982962 80.025799,19.273868 79.132559,19.273868 C 78.161469,19.273868 77.249479,18.982966 76.628039,18.283664 C 76.336779,17.953831 76.123379,17.507213 75.987839,16.924699 L 80.208409,16.924699 L 86.205549,19.579283 C 85.790079,20.315397 85.262779,20.995586 84.618679,21.618445 z M 77.076429,15.546632 L 77.050949,15.527168 L 77.094829,15.546632 L 77.076429,15.546632 z M 80.686879,14.633578 L 80.860299,14.633578 L 80.860299,13.255504 L 77.573299,13.255504 L 76.238049,12.664496 C 76.353059,12.406151 76.488959,12.175055 76.647499,11.994215 C 77.249479,11.255278 78.103439,10.945264 79.035599,10.945264 C 79.889909,10.945264 80.685469,11.197238 81.190129,11.410994 L 81.733709,9.1977216 C 81.034409,8.8877066 80.005979,8.6159136 78.821839,8.6159136 C 76.997149,8.6159136 75.443899,9.3534366 74.337259,10.595615 C 74.091659,10.879439 73.878609,11.197948 73.685379,11.534859 L 69.871779,9.8471216 C 70.241249,9.2929176 70.675839,8.7606566 71.179079,8.2531686 C 72.998819,6.3973326 75.223419,5.4694136 77.855699,5.4694136 C 80.487279,5.4694136 82.722499,6.3973326 84.561349,8.2531686 C 86.418599,10.089188 87.347229,12.33077 87.347229,14.979339 C 87.347229,15.852048 87.248129,16.675215 87.052779,17.450956 L 80.686879,14.633578 z" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 22 KiB

@ -0,0 +1,7 @@
# Introduction
## License
![CC-BY-NC-SA](images/by-nc-sa.eu.svg)
This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).

@ -0,0 +1 @@
# Locations

@ -0,0 +1,48 @@
# Light
`https://picc.app/schemata/v0.1-dev/devices/light`
A light entity.
## Type - `object`
---
#### **description** - `string`
Human-readable description of the entity for UI display purposes.
| Constraint | |
|-|-|
| `maxLength` | 1000 |
---
#### **id** - `string` - *required*
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracters `-` and `_`.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 50 |
| `pattern` | `^[0-9a-zA-Z-_]+$` |
---
#### **name** - `string` - *required*
Human-readable name of the entity for UI display purposes.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 100 |

@ -0,0 +1,48 @@
# Sensor
`https://picc.app/schemata/v0.1-dev/devices/sensor`
A sensor device entity.
## Type - `object`
---
#### **description** - `string`
Human-readable description of the entity for UI display purposes.
| Constraint | |
|-|-|
| `maxLength` | 1000 |
---
#### **id** - `string` - *required*
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracters `-` and `_`.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 50 |
| `pattern` | `^[0-9a-zA-Z-_]+$` |
---
#### **name** - `string` - *required*
Human-readable name of the entity for UI display purposes.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 100 |

@ -0,0 +1,50 @@
# Entity
`https://picc.app/schemata/v0.1-dev/entity`
An entity in picc.
It must have an `id` as an internal identifier and a human-readable `name`.
## Type - `object`
---
#### **description** - `string`
Human-readable description of the entity for UI display purposes.
| Constraint | |
|-|-|
| `maxLength` | 1000 |
---
#### **id** - `string` - *required*
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracters `-` and `_`.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 50 |
| `pattern` | `^[0-9a-zA-Z-_]+$` |
---
#### **name** - `string` - *required*
Human-readable name of the entity for UI display purposes.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 100 |

@ -0,0 +1,78 @@
# Relationship
`https://picc.app/schemata/v0.1-dev/relationship`
Describes a relationship between two entities.
## Type - `object`
---
#### **arg** - `any`
Additional arguments. Can be any JSON type.
---
#### **description** - `string`
Human-readable description of the entity for UI display purposes.
| Constraint | |
|-|-|
| `maxLength` | 1000 |
---
#### **entities** - `array`
Entities invloved in the relationship.
**Elements:**
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 50 |
| `pattern` | `^[0-9a-zA-Z-_]+$` |
---
#### **id** - `string` - *required*
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracters `-` and `_`.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 50 |
| `pattern` | `^[0-9a-zA-Z-_]+$` |
---
#### **module** - `string`
Module name of the relationship.
| Constraint | |
|-|-|
---
#### **name** - `string` - *required*
Human-readable name of the entity for UI display purposes.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 100 |

@ -0,0 +1,73 @@
# Room
`https://picc.app/schemata/v0.1-dev/room`
A room
## Type - `object`
---
#### **description** - `string`
Human-readable description of the entity for UI display purposes.
| Constraint | |
|-|-|
| `maxLength` | 1000 |
---
#### **id** - `string` - *required*
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracters `-` and `_`.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 50 |
| `pattern` | `^[0-9a-zA-Z-_]+$` |
---
#### **name** - `string` - *required*
Human-readable name of the entity for UI display purposes.
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 100 |
---
#### **relationships** - `array`
Relationships that bind other entities to this room.
**Elements:**
`ref`
See https://picc.app/schemata/v0.1-dev/relationship
*or*
`string`
| Constraint | |
|-|-|
| `minLength` | 1 |
| `maxLength` | 50 |
| `pattern` | `^[0-9a-zA-Z-_]+$` |

@ -0,0 +1 @@
# Relationships

@ -0,0 +1 @@
# Transformers

@ -0,0 +1,56 @@
# picc Tree
Data in picc is structured in a tree of paths, rooted at `app.picc.<domain>`, where `<domain>` uniquely identifies the
server. It must be a series of strings composed of lower case letters, numbers and/or symbols `-` and `_`, separated by
periods (`.`); in other words a hostname.
The same structure is used for the [directory](#data-directory), where data can be queried, and the [data
streams](#data-streams), which are AMQP topics/routing keys for pub-sub access to the data.
## Data Directory
The picc directory is key-value store where keys are picc paths and values are JSON documents. It serves both as a place
for looking up system configuration and for latest values in the data streams.
System information is available under
> `app.picc.<domain>.sys.people.person_<id>`
for information about people, and
> `app.picc.<domain>.sys.places.site_<id>.building_<id>.room_<id>`
for information about the building.
Data stream values are available under the same paths they are using to publish to AMQP, see [Data
Streams](#data-streams).
## Data Streams
Data streams are AMQP routing keys where drivers and entities publish their data.
### Entity Tree
Like the system tree, the entity streams tree is divided into people streams
> `app.picc.<domain>.streams.people.person_<id>`
and location streams
> `app.picc.<domain>.streams.places.site_<id>.building_<id>.room_<id>`
These streams are publishing processed data and are meant for user consumption.
### Device Tree
The device tree, like the entity tree, contains streams of data. In this case, the data is coming from devices in
relatively raw form.
Leaves in the device tree are the basic building blocks of picc. They are AMQP topics where device drivers post data and
accept commands. This data is meant to be processed by entities into user-friendly streams.
> `app.picc.<domain>.dev.lights.light_<id>.*`
>
> `app.picc.<domain>.dev.sensors.sensor_<id>.*`
>
> `app.picc.<domain>.dev.transformers.transformer_<id>`

@ -0,0 +1,5 @@
{
"id": "light1",
"name": "The First Light",
"description": "Just a li'l' light."
}

@ -0,0 +1,21 @@
{
"id": "living_room",
"name": "Living Room",
"description": "The living room.",
"relationshios": [
{
"id": "living_room_temp",
"name": "Temperature in the living room",
"module": "Picc.Relationships.AverageTemperature",
"entities": [
"living_room",
"therm1",
"themr2"
],
"arg": {
"prior_mean": 20,
"prior_variance": 3
}
}
]
}

@ -0,0 +1,43 @@
{
'$id': 'https://picc.app/schemata/v0.1-dev/entity',
'$schema': 'http://json-schema.org/draft-07/schema',
title: 'Entity',
description: |||
An entity in picc.
It must have an `id` as an internal identifier and a human-readable `name`.
|||,
type: 'object',
properties: {
id: {
description: |||
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracters `-` and `_`.
|||,
type: 'string',
minLength: 1,
maxLength: 50,
pattern: '^[0-9a-zA-Z-_]+$',
},
name: {
type: 'string',
description: |||
Human-readable name of the entity for UI display purposes.
|||,
minLength: 1,
maxLength: 100,
},
description: {
type: 'string',
description: |||
Human-readable description of the entity for UI display purposes.
|||,
maxLength: 1000,
},
},
required: [
'id',
'name',
],
}

@ -0,0 +1,126 @@
{
tangle(object)::
{
[std.strReplace(object['$id'], 'https://picc.app/', '')]: object,
},
weave(object):: {
[std.strReplace(object['$id'], 'https://picc.app/schemata', 'doc_src/reference') + '.md']:
|||
# %(title)s
ID: `%(uri)s`
%(description)s
## Type - `%(type)s`
%(type_docs)s
||| % (object + { type_docs: weave_type(object), uri:object['$id'] }),
},
local weave_type(object) =
if get_type(object) == 'oneOf' then
weave_one_of_type(object)
else if get_type(object) == 'ref' then
weave_ref(object)
else if get_type(object) == 'string' then
weave_string_type(object)
else if get_type(object) == 'object' then
weave_object_type(object)
else if get_type(object) == 'array' then
weave_array_type(object)
else if get_type(object) == 'any' then
''
else
error 'Unknown schema type',
// Weave functions for `string` type schemas.
local string_constraints = ['minLength', 'maxLength', 'pattern'],
local weave_string_type(object) =
|||
| Constraint | |
|-|-|
||| +
std.join('', [
(if std.objectHas(object, constraint) then |||
| `%(constraint)s` | %(constraint_value)s |
||| % {
constraint: constraint,
constraint_value: if std.type(object[constraint]) == 'string' then
std.format('`%s`', object[constraint])
else
object[constraint],
})
for constraint in string_constraints
]),
// Weave fuctions for `object` type schemas
local weave_object_type(object) =
std.join('', [
if !std.objectHas(object.properties[property], '$ref') then
|||
---
#### **%(property)s** - `%(property_type)s` %(property_required)s
%(property_description)s
%(property_type_docs)s
||| % {
property: property,
property_required: if std.setMember(property, object.required) then '- *required*' else '',
property_description: object.properties[property].description,
property_type: get_type(object.properties[property]),
property_type_docs: if get_type(object.properties[property]) != 'object' then weave_type(object.properties[property]),
}
else
|||
#### %(property_required)s%(property)s%(property_required)s - Ref
See %(property_ref)s
||| % {
property: property,
property_required: if std.setMember(property, object.required) then '**' else '',
property_ref: object.properties[property]['$ref'],
}
for property in std.objectFields(object.properties)
]),
// Weave functions for `array` type schemas
local weave_array_type(object) =
|||
**Elements:**
%(elements_type_docs)s
||| % {
elements_type_docs: weave_type(object.items),
},
// Weave composite schemas
local weave_one_of_type(object) =
std.join(
|||
*or*
|||,
[|||
`%(option_type)s`
||| % { option_type: get_type(type) } + weave_type(type) for type in object.oneOf]
),
local weave_ref(object) =
|||
See %(ref)s
||| % { ref: object['$ref'] },
// Util functions
local get_type(object) =
if std.objectHas(object, '$ref') then 'ref'
else if std.objectHas(object, 'oneOf') then 'oneOf'
else if std.objectHas(object, 'type') then object.type
else 'any',
}

@ -0,0 +1,10 @@
local entity = import 'entity.libsonnet';
entity
{
'$id': 'https://picc.app/schemata/v0.1-dev/devices/light',
title: 'Light',
description: |||
A light entity.
|||,
}

@ -0,0 +1,10 @@
local entity = import 'entity.libsonnet';
entity
{
'$id': 'https://picc.app/schemata/v0.1-dev/devices/sensor',
title: 'Sensor',
description: |||
A sensor device entity.
|||,
}

@ -0,0 +1,7 @@
local loom = import 'lib/loom.libsonnet';
loom.weave(import 'src/entity.jsonnet') +
loom.weave(import 'src/room.jsonnet') +
loom.weave(import 'src/relationship.jsonnet') +
loom.weave(import 'src/devices/light.jsonnet') +
loom.weave(import 'src/devices/sensor.jsonnet')

@ -0,0 +1 @@
import '../lib/entity.libsonnet'

@ -0,0 +1,37 @@
local entity = import '../lib/entity.libsonnet';
entity
{
'$id': 'https://picc.app/schemata/v0.1-dev/locations/building',
title: 'Building',
description: |||
A building
|||,
properties+: {
rooms: {
type: 'array',
description: 'Rooms contained in this building.',
items: {
oneOf: [
{
'$ref': 'https://picc.app/schemata/v0.1-dev/room',
},
$.properties.id,
],
},
},
relationships: {
type: 'array',
description: 'Relationships that bind other entities to this room.',
items: {
oneOf: [
{
'$ref': 'https://picc.app/schemata/v0.1-dev/relationship',
},
$.properties.id,
],
},
},
},
}

@ -0,0 +1,25 @@
local entity = import '../lib/entity.libsonnet';
entity
{
'$id': 'https://picc.app/schemata/v0.1-dev/locations/room',
title: 'Room',
description: |||
A room
|||,
properties+: {
relationships: {
type: 'array',
description: 'Relationships that bind other entities to this room.',
items: {
oneOf: [
{
'$ref': 'https://picc.app/schemata/v0.1-dev/relationship',
},
$.properties.id,
],
},
},
},
}

@ -0,0 +1,37 @@
local entity = import '../lib/entity.libsonnet';
entity
{
'$id': 'https://picc.app/schemata/v0.1-dev/locations/site',
title: 'Site',
description: |||
A site
|||,
properties+: {
buildings: {
type: 'array',
description: 'Buildings at this site.',
items: {
oneOf: [
{
'$ref': 'https://picc.app/schemata/v0.1-dev/building',
},
$.properties.id,
],
},
},
relationships: {
type: 'array',
description: 'Relationships that bind other entities to this room.',
items: {
oneOf: [
{
'$ref': 'https://picc.app/schemata/v0.1-dev/relationship',
},
$.properties.id,
],
},
},
},
}

@ -0,0 +1,29 @@
local entity = import '../lib/entity.libsonnet';
entity
{
'$id': 'https://picc.app/schemata/v0.1-dev/relationship',
title: 'Relationship',
description: 'Describes a relationship between two entities.',
properties+: {
module: {
type: 'string',
description: 'Module name of the relationship.',
},
entities: {
type: 'array',
description: 'Entities invloved in the relationship.',
items:
$.properties.id,
},
arg: {
description: 'Additional arguments. Can be any JSON type.',
},
},
required+: [
'module',
'entities',
],
}

@ -0,0 +1,11 @@
local loom = import 'lib/loom.libsonnet';
loom.tangle(import 'src/entity.jsonnet') +
loom.tangle(import 'src/locations/room.jsonnet') +
loom.tangle(import 'src/locations/building.jsonnet') +
loom.tangle(import 'src/locations/site.jsonnet') +
loom.tangle(import 'src/relationship.jsonnet') +
loom.tangle(import 'src/devices/light.jsonnet') +
loom.tangle(import 'src/devices/sensor.jsonnet')
Loading…
Cancel
Save