openapi.yaml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. openapi: 3.0.1
  2. info:
  3. title: ESP8266 MiLight Hub
  4. description: Official documention for MiLight Hub's REST API.
  5. contact:
  6. email: chris@sidoh.org
  7. license:
  8. name: MIT
  9. version: 1.0.0
  10. servers:
  11. - url: http://milight-hub
  12. tags:
  13. - name: system
  14. description: Routes that return system information and allow you to control the device.
  15. - name: settings
  16. description: Read and write settings
  17. - name: devices
  18. description: Control lighting devices
  19. - name: transitions
  20. description: Control transitions
  21. paths:
  22. /about:
  23. get:
  24. tags:
  25. - system
  26. summary: Get system information
  27. responses:
  28. 200:
  29. description: success
  30. content:
  31. application/json:
  32. schema:
  33. $ref: '#/components/schemas/About'
  34. /remote_configs:
  35. get:
  36. tags:
  37. - system
  38. summary: Returns list of supported remote types
  39. responses:
  40. 200:
  41. description: success
  42. content:
  43. applicaiton/json:
  44. schema:
  45. type: array
  46. items:
  47. type: string
  48. example:
  49. $ref: '#/components/schemas/RemoteType/enum'
  50. /system:
  51. post:
  52. tags:
  53. - system
  54. summary: Control system
  55. description: >
  56. Send commands to the system. Supported commands:
  57. 1. `restart`. Restart the ESP8266.
  58. 1. `clear_wifi_config`. Clears on-board wifi information. ESP8266 will reboot and enter wifi config mode.
  59. requestBody:
  60. content:
  61. application/json:
  62. schema:
  63. type: object
  64. required:
  65. - command
  66. properties:
  67. command:
  68. type: string
  69. enum:
  70. - restart
  71. - clear_wifi_config
  72. responses:
  73. 200:
  74. description: command handled successfully
  75. content:
  76. application/json:
  77. schema:
  78. $ref: '#/components/schemas/BooleanResponse'
  79. 400:
  80. description: error
  81. content:
  82. application/json:
  83. schema:
  84. $ref: '#/components/schemas/BooleanResponse'
  85. /settings:
  86. get:
  87. tags:
  88. - settings
  89. summary: Get existing settings
  90. responses:
  91. 200:
  92. description: success
  93. content:
  94. application/json:
  95. schema:
  96. $ref: '#/components/schemas/Settings'
  97. put:
  98. tags:
  99. - settings
  100. summary: Patch existing settings with provided keys
  101. requestBody:
  102. content:
  103. application/json:
  104. schema:
  105. $ref: '#/components/schemas/Settings'
  106. responses:
  107. 200:
  108. description: success
  109. content:
  110. application/json:
  111. schema:
  112. $ref: '#/components/schemas/BooleanResponse'
  113. post:
  114. tags:
  115. - settings
  116. summary: Overwrite existing settings with the provided file
  117. requestBody:
  118. content:
  119. application/json:
  120. schema:
  121. $ref: '#/components/schemas/Settings'
  122. responses:
  123. 200:
  124. description: success
  125. content:
  126. application/json:
  127. schema:
  128. $ref: '#/components/schemas/BooleanResponse'
  129. /gateway_traffic/{remote-type}:
  130. get:
  131. tags:
  132. - devices
  133. summary: Read a packet
  134. description:
  135. Read a packet. Does not return a response until a packet is read.
  136. If `remote-type` is unspecified, will read from all remote types simultaneously.
  137. parameters:
  138. - $ref: '#/components/parameters/RemoteType'
  139. responses:
  140. 200:
  141. description: success
  142. content:
  143. application/json:
  144. schema:
  145. type: object
  146. properties:
  147. packet_info:
  148. type: string
  149. /gateways/{device-id}/{remote-type}/{group-id}:
  150. parameters:
  151. - $ref: '#/components/parameters/DeviceId'
  152. - $ref: '#/components/parameters/RemoteType'
  153. - $ref: '#/components/parameters/GroupId'
  154. get:
  155. tags:
  156. - devices
  157. summary:
  158. Get device state
  159. parameters:
  160. - $ref: '#/components/parameters/BlockOnQueue'
  161. responses:
  162. 200:
  163. description: success
  164. content:
  165. application/json:
  166. schema:
  167. $ref: '#/components/schemas/GroupState'
  168. put:
  169. tags:
  170. - devices
  171. summary:
  172. Patch device state with the specified keys
  173. parameters:
  174. - $ref: '#/components/parameters/BlockOnQueue'
  175. requestBody:
  176. content:
  177. application/json:
  178. schema:
  179. allOf:
  180. - $ref: '#/components/schemas/GroupState'
  181. - $ref: '#/components/schemas/GroupStateCommands'
  182. responses:
  183. 400:
  184. description: error with request
  185. content:
  186. application/json:
  187. schema:
  188. $ref: '#/components/schemas/BooleanResponse'
  189. 200:
  190. description: success
  191. content:
  192. application/json:
  193. schema:
  194. $ref: '#/components/schemas/GroupState'
  195. delete:
  196. tags:
  197. - devices
  198. summary:
  199. Delete kept state for given device
  200. responses:
  201. 200:
  202. description: success
  203. content:
  204. application/json:
  205. schema:
  206. $ref: '#/components/schemas/BooleanResponse'
  207. /gateways/{device-alias}:
  208. parameters:
  209. - $ref: '#/components/parameters/DeviceAlias'
  210. get:
  211. tags:
  212. - devices
  213. summary: Get state for the provided alias
  214. responses:
  215. 404:
  216. description: provided device alias does not exist
  217. 200:
  218. description: success
  219. content:
  220. application/json:
  221. schema:
  222. $ref: '#/components/schemas/GroupState'
  223. put:
  224. tags:
  225. - devices
  226. summary: Patch device state with the specified keys
  227. parameters:
  228. - $ref: '#/components/parameters/BlockOnQueue'
  229. requestBody:
  230. content:
  231. application/json:
  232. schema:
  233. allOf:
  234. - $ref: '#/components/schemas/GroupState'
  235. - $ref: '#/components/schemas/GroupStateCommands'
  236. responses:
  237. 400:
  238. description: error with request
  239. content:
  240. application/json:
  241. schema:
  242. $ref: '#/components/schemas/BooleanResponse'
  243. 200:
  244. description: success
  245. content:
  246. application/json:
  247. schema:
  248. $ref: '#/components/schemas/GroupState'
  249. delete:
  250. tags:
  251. - devices
  252. summary: Delete kept state for given device
  253. responses:
  254. 200:
  255. description: success
  256. content:
  257. application/json:
  258. schema:
  259. $ref: '#/components/schemas/BooleanResponse'
  260. /raw_commands/{remote-type}:
  261. parameters:
  262. - $ref: '#/components/parameters/RemoteType'
  263. post:
  264. tags:
  265. - devices
  266. summary: Send a raw packet
  267. requestBody:
  268. content:
  269. application/json:
  270. schema:
  271. type: object
  272. properties:
  273. packet:
  274. type: string
  275. pattern: "([A-Fa-f0-9]{2}[ ])+"
  276. description: Raw packet to send
  277. example: '01 02 03 04 05 06 07 08 09'
  278. num_repeats:
  279. type: integer
  280. minimum: 1
  281. description: Number of repeated packets to send
  282. example: 50
  283. responses:
  284. 200:
  285. description: success
  286. content:
  287. applicaiton/json:
  288. schema:
  289. $ref: '#/components/schemas/BooleanResponse'
  290. /transitions:
  291. get:
  292. tags:
  293. - transitions
  294. summary: Get all active transitions
  295. responses:
  296. 200:
  297. description: success
  298. content:
  299. application/json:
  300. schema:
  301. type: array
  302. items:
  303. $ref: '#/components/schemas/TransitionData'
  304. post:
  305. tags:
  306. - transitions
  307. summary: Create a new transition
  308. requestBody:
  309. content:
  310. application/json:
  311. schema:
  312. $ref: '#/components/schemas/TransitionData'
  313. responses:
  314. 400:
  315. description: error
  316. content:
  317. application/json:
  318. schema:
  319. $ref: '#/components/schemas/BooleanResponse'
  320. 200:
  321. description: success
  322. content:
  323. application/json:
  324. schema:
  325. $ref: '#/components/schemas/BooleanResponse'
  326. /transitions/{id}:
  327. parameters:
  328. - name: id
  329. in: path
  330. description: ID of transition
  331. schema:
  332. type: integer
  333. required: true
  334. get:
  335. tags:
  336. - transitions
  337. summary: Get properties for provided transition ID
  338. responses:
  339. 404:
  340. description: Provided transition ID not found
  341. 200:
  342. description: success
  343. content:
  344. application/json:
  345. schema:
  346. $ref: '#/components/schemas/TransitionData'
  347. delete:
  348. tags:
  349. - transitions
  350. summary: Delete provided transition
  351. responses:
  352. 404:
  353. description: Provided transition ID not found
  354. content:
  355. application/json:
  356. schema:
  357. $ref: '#/components/schemas/BooleanResponse'
  358. 200:
  359. description: success
  360. content:
  361. application/json:
  362. schema:
  363. $ref: '#/components/schemas/BooleanResponse'
  364. /firmware:
  365. post:
  366. tags:
  367. - system
  368. summary:
  369. Update firmware
  370. requestBody:
  371. description: Firmware file
  372. content:
  373. multipart/form-data:
  374. schema:
  375. type: object
  376. properties:
  377. fileName:
  378. type: string
  379. format: binary
  380. responses:
  381. 200:
  382. description: success
  383. 500:
  384. description: server error
  385. components:
  386. parameters:
  387. DeviceAlias:
  388. name: device-alias
  389. in: path
  390. description: Device alias saved in settings
  391. schema:
  392. type: string
  393. required: true
  394. BlockOnQueue:
  395. name: blockOnQueue
  396. in: query
  397. description: If true, response will block on update packets being sent before returning
  398. schema:
  399. type: boolean
  400. required: false
  401. GroupId:
  402. name: group-id
  403. in: path
  404. description: >
  405. Group ID. Should be 0-8, depending on remote type. Group 0 is a "wildcard" group. All bulbs paired with the same device ID will respond to commands sent to Group 0.
  406. schema:
  407. type: integer
  408. minimum: 0
  409. maximum: 8
  410. required: true
  411. DeviceId:
  412. name: device-id
  413. in: path
  414. description: 2-byte device ID. Can be decimal or hexadecimal.
  415. schema:
  416. oneOf:
  417. - type: integer
  418. minimum: 0
  419. maximum: 65535
  420. - type: string
  421. pattern: '0x[a-fA-F0-9]+'
  422. example: '0x1234'
  423. required: true
  424. RemoteType:
  425. name: remote-type
  426. in: path
  427. description: Type of remote to read a packet from. If unspecified, will read packets from all remote types.
  428. schema:
  429. $ref: '#/components/schemas/RemoteType'
  430. required: true
  431. schemas:
  432. State:
  433. description: "On/Off state"
  434. type: string
  435. enum:
  436. - On
  437. - Off
  438. example: On
  439. GroupStateCommand:
  440. type: string
  441. enum:
  442. - unpair
  443. - pair
  444. - set_white
  445. - night_mode
  446. - level_up
  447. - level_down
  448. - temperature_up
  449. - temperature_down
  450. - next_mode
  451. - previous_mode
  452. - mode_speed_down
  453. - mode_speed_up
  454. - toggle
  455. example: pair
  456. description: >
  457. Commands that affect a given group. Descriptiosn follow:
  458. * `pair`. Emulates the pairing process. Send this command right as you connect an unpaired bulb and it will pair with the device ID being used.
  459. * `unpair`. Emulates the unpairing process. Send as you connect a paired bulb to have it disassociate with the device ID being used.
  460. * `set_white`. Turns off RGB and enters WW/CW mode.
  461. * `night_mode`. Most devices support a "night mode," which has LEDs turned to a very dim setting -- lower than brightness 0.
  462. * `level_up`. Turns down the brightness. Not all dimmable bulbs support this command.
  463. * `level_down`. Turns down the brightness. Not all dimmable bulbs support this command.
  464. * `temperature_up`. Turns up the white temperature. Not all bulbs with adjustable white temperature support this command.
  465. * `temperature_down`. Turns down the white temperature. Not all bulbs with adjustable white temperature support this command.
  466. * `next_mode`. Cycles to the next "disco mode".
  467. * `previous_mode`. Cycles to the previous disco mode.
  468. * `mode_speed_up`. Turn transition speed for current mode up.
  469. * `mode_speed_down`. Turn transition speed for current mode down.
  470. * `toggle`. Toggle on/off state.
  471. TransitionField:
  472. type: string
  473. enum:
  474. - hue
  475. - saturation
  476. - brightness
  477. - level
  478. - kelvin
  479. - color_temp
  480. - color
  481. - status
  482. example: brightness
  483. description: >
  484. If transitioning `status`:
  485. * If transitioning to `OFF`, will fade to 0 brightness and then turn off.
  486. * If transitioning to `ON`, will turn on, set brightness to 0, and fade to brightness 100.
  487. TransitionValue:
  488. oneOf:
  489. - type: integer
  490. - type: string
  491. pattern: '[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}'
  492. description: Either an int value or a color
  493. TransitionArgs:
  494. type: object
  495. properties:
  496. field:
  497. $ref: '#/components/schemas/TransitionField'
  498. start_value:
  499. $ref: '#/components/schemas/TransitionValue'
  500. end_value:
  501. $ref: '#/components/schemas/TransitionValue'
  502. duration:
  503. type: number
  504. format: float
  505. description: Duration of transition, measured in seconds
  506. period:
  507. type: integer
  508. description: Length of time between updates in a transition, measured in milliseconds
  509. num_periods:
  510. type: integer
  511. description: Number of packets sent over the course of the transition
  512. TransitionData:
  513. allOf:
  514. - $ref: '#/components/schemas/TransitionArgs'
  515. - type: object
  516. properties:
  517. id:
  518. type: integer
  519. last_sent:
  520. type: integer
  521. description: Timestamp since last update was sent.
  522. bulb:
  523. $ref: '#/components/schemas/BulbId'
  524. type:
  525. type: string
  526. enum:
  527. - field
  528. - color
  529. current_value:
  530. $ref: '#/components/schemas/TransitionValue'
  531. end_value:
  532. $ref: '#/components/schemas/TransitionValue'
  533. BulbId:
  534. type: object
  535. properties:
  536. device_id:
  537. type: integer
  538. minimum: 0
  539. maximum: 65536
  540. example: 1234
  541. group_id:
  542. type: integer
  543. minimum: 0
  544. maximum: 8
  545. example: 1
  546. device_type:
  547. $ref: '#/components/schemas/RemoteType'
  548. GroupStateCommands:
  549. type: object
  550. properties:
  551. command:
  552. oneOf:
  553. - $ref: '#/components/schemas/GroupStateCommand'
  554. - type: object
  555. properties:
  556. command:
  557. type: string
  558. enum:
  559. - transition
  560. args:
  561. $ref: '#/components/schemas/TransitionArgs'
  562. commands:
  563. type: array
  564. items:
  565. $ref: '#/components/schemas/GroupStateCommand'
  566. example:
  567. - level_up
  568. - temperature_up
  569. GroupState:
  570. type: object
  571. properties:
  572. state:
  573. $ref: '#/components/schemas/State'
  574. status:
  575. $ref: '#/components/schemas/State'
  576. hue:
  577. type: integer
  578. minimum: 0
  579. maximum: 359
  580. description: Color hue. Will change bulb to color mode.
  581. saturation:
  582. type: integer
  583. minimum: 0
  584. maximum: 100
  585. description: Color saturation. Will normally change bulb to color mode.
  586. kelvin:
  587. type: integer
  588. minimum: 0
  589. maximum: 100
  590. description: White temperature. 0 is coolest, 100 is warmest.
  591. temperature:
  592. type: integer
  593. minimum: 0
  594. maximum: 100
  595. description: Alias for `kelvin`.
  596. color_temp:
  597. type: integer
  598. minimum: 153
  599. maximum: 370
  600. description: White temperature measured in mireds. Lower values are cooler.
  601. mode:
  602. type: integer
  603. description: Party mode ID. Actual effect depends on the bulb.
  604. color:
  605. oneOf:
  606. - type: string
  607. pattern: '[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}'
  608. - type: object
  609. properties:
  610. r:
  611. type: integer
  612. g:
  613. type: integer
  614. b:
  615. type: integer
  616. example:
  617. '255,0,255'
  618. level:
  619. type: integer
  620. minimum: 0
  621. maximum: 100
  622. description: Brightness on a 0-100 scale.
  623. example: 50
  624. brightness:
  625. type: integer
  626. minimum: 0
  627. maximum: 255
  628. description: Brightness on a 0-255 scale.
  629. example: 170
  630. effect:
  631. type: string
  632. enum:
  633. - night_mode
  634. - white_mode
  635. transition:
  636. type: number
  637. description: >
  638. Enables a transition from current state to the provided state.
  639. example: 2.0
  640. RemoteType:
  641. type: string
  642. enum:
  643. - "rgbw"
  644. - "cct"
  645. - "rgb_cct"
  646. - "rgb"
  647. - "fut089"
  648. - "fut091"
  649. - "fut020"
  650. example: rgb_cct
  651. RF24Channel:
  652. type: string
  653. enum:
  654. - LOW
  655. - MID
  656. - HIGH
  657. LedMode:
  658. type: string
  659. enum:
  660. - Off
  661. - Slow toggle
  662. - Fast toggle
  663. - Slow blip
  664. - Fast blip
  665. - Flicker
  666. - On
  667. GroupStateField:
  668. type: string
  669. enum:
  670. - state
  671. - status
  672. - brightness
  673. - level
  674. - hue
  675. - saturation
  676. - color
  677. - mode
  678. - kelvin
  679. - color_temp
  680. - bulb_mode
  681. - computed_color
  682. - effect
  683. - device_id
  684. - group_id
  685. - device_type
  686. - oh_color
  687. description: >
  688. Defines a field which is a part of state for a particular light device. Most fields are self-explanatory, but documentation for each follows:
  689. * `state` / `status` - same value with different keys (useful if your platform expects one or the other).
  690. * `brightness` / `level` - [0, 255] and [0, 100] scales of the same value.
  691. * `kelvin / color_temp` - [0, 100] and [153, 370] scales for the same value. The later's unit is mireds.
  692. * `bulb_mode` - what mode the bulb is in: white, rgb, etc.
  693. * `color` / `computed_color` - behaves the same when bulb is in rgb mode. `computed_color` will send RGB = 255,255,255 when in white mode. This is useful for HomeAssistant where it always expects the color to be set.
  694. * `oh_color` - same as `color` with a format compatible with [OpenHAB's colorRGB channel type](https://www.openhab.org/addons/bindings/mqtt.generic/#channel-type-colorrgb-colorhsb).
  695. * `device_id` / `device_type` / `group_id` - this information is in the MQTT topic or REST route, but can be included in the payload in the case that processing the topic or route is more difficult.
  696. DeviceId:
  697. type: array
  698. items: {}
  699. example:
  700. - 1234
  701. - "rgb_cct"
  702. - 1
  703. Settings:
  704. type: object
  705. properties:
  706. admin_username:
  707. type: string
  708. description: If spcified along with `admin_password`, HTTP basic auth will be enabled to access all REST endpoints.
  709. default: ""
  710. admin_password:
  711. type: string
  712. description: If spcified along with `admin_username`, HTTP basic auth will be enabled to access all REST endpoints.
  713. default: ""
  714. ce_pin:
  715. type: integer
  716. description: CE pin to use for SPI radio (nRF24, LT8900)
  717. default: 4
  718. csn_pin:
  719. type: integer
  720. description: CSN pin to use with nRF24
  721. default: 15
  722. reset_pin:
  723. type: integer
  724. description: Reset pin to use with LT8900
  725. default: 0
  726. led_pin:
  727. type: integer
  728. description: Pin to control for status LED. Set to a negative value to invert on/off status.
  729. default: -2
  730. packet_repeats:
  731. type: integer
  732. description: Number of times to resend the same 2.4 GHz milight packet when a command is sent.
  733. default: 50
  734. http_repeat_factor:
  735. type: integer
  736. description: Packet repeats resulting from REST commands will be multiplied by this number.
  737. default: 1
  738. auto_restart_period:
  739. type: integer
  740. description: Automatically restart the device after the number of specified minutes. Use 0 to disable.
  741. default: 0
  742. mqtt_server:
  743. type: string
  744. description: MQTT server to connect to.
  745. format: hostname
  746. mqtt_username:
  747. type: string
  748. description: If specified, use this username to authenticate with the MQTT server.
  749. mqtt_password:
  750. type: string
  751. description: If specified, use this password to authenticate with the MQTT server.
  752. mqtt_topic_pattern:
  753. type: string
  754. description: Topic pattern to listen on for commands. More detail on the format in README.
  755. example: milight/commands/:device_id/:device_type/:group_id
  756. mqtt_update_topic_pattern:
  757. type: string
  758. description: Topic pattern individual intercepted commands will be sent to. More detail on the format in README.
  759. example: milight/updates/:device_id/:device_type/:group_id
  760. mqtt_update_state_pattern:
  761. type: string
  762. description: Topic pattern device state will be sent to. More detail on the format in README.
  763. example: milight/state/:device_id/:device_type/:group_id
  764. mqtt_client_status_topic:
  765. type: string
  766. description: Topic client status will be sent to.
  767. example: milight/status
  768. simple_mqtt_client_status:
  769. type: boolean
  770. description: If true, will use a simple enum flag (`connected` or `disconnected`) to indicate status. If false, will send a rich JSON message including IP address, version, etc.
  771. default: true
  772. discovery_port:
  773. type: integer
  774. description: UDP discovery port
  775. default: 48899
  776. listen_repeats:
  777. type: integer
  778. description: Controls how many cycles are spent listening for packets. Set to 0 to disable passive listening.
  779. default: 3
  780. state_flush_interval:
  781. type: integer
  782. description: Controls how many miliseconds must pass between states being flushed to persistent storage. Set to 0 to disable throttling.
  783. default: 10000
  784. mqtt_state_rate_limit:
  785. type: integer
  786. description: Controls how many miliseconds must pass between MQTT state updates. Set to 0 to disable throttling.
  787. default: 500
  788. packet_repeat_throttle_threshold:
  789. type: integer
  790. description:
  791. Controls how packet repeats are throttled. Packets sent with less time (measured in milliseconds) between them than this value (in milliseconds) will cause packet repeats to be throttled down. More than this value will unthrottle up.
  792. default: 200
  793. packet_repeat_throttle_sensitivity:
  794. type: integer
  795. description:
  796. Controls how packet repeats are throttled. Higher values cause packets to be throttled up and down faster. Set to 0 to disable throttling.
  797. default: 0
  798. minimum: 0
  799. maximum: 1000
  800. packet_repeat_minimum:
  801. type: integer
  802. description:
  803. Controls how far throttling can decrease the number of repeated packets
  804. default: 3
  805. enable_automatic_mode_switching:
  806. type: boolean
  807. description:
  808. When making updates to hue or white temperature in a different bulb mode, switch back to the original bulb mode after applying the setting change.
  809. default: false
  810. led_mode_wifi_config:
  811. $ref: '#/components/schemas/LedMode'
  812. led_mode_wifi_failed:
  813. $ref: '#/components/schemas/LedMode'
  814. led_mode_operating:
  815. $ref: '#/components/schemas/LedMode'
  816. led_mode_packet:
  817. $ref: '#/components/schemas/LedMode'
  818. led_mode_packet_count:
  819. type: integer
  820. description: Number of times the LED will flash when packets are changing
  821. default: 3
  822. hostname:
  823. type: string
  824. description: Hostname that will be advertized on a DHCP request
  825. pattern: "[a-zA-Z0-9-]+"
  826. default: milight-hub
  827. rf24_power_level:
  828. type: string
  829. enum:
  830. - MIN
  831. - LOW
  832. - HIGH
  833. - MAX
  834. description: Power level used when packets are sent. See nRF24 documentation for further detail.
  835. default: MAX
  836. rf24_listen_channel:
  837. $ref: '#/components/schemas/RF24Channel'
  838. wifi_static_ip:
  839. type: string
  840. format: ipv4
  841. description: If specified, the static IP address to use
  842. wifi_static_ip_gateway:
  843. type: string
  844. format: ipv4
  845. description: If specified along with static IP, the gateway address to use
  846. wifi_static_ip_netmask:
  847. type: string
  848. format: ipv4
  849. description: If specified along with static IP, the netmask to use
  850. packet_repeats_per_loop:
  851. type: integer
  852. default: 10
  853. description: Packets are sent asynchronously. This number controls the number of repeats sent during each iteration. Increase this number to improve packet throughput. Decrease to improve system multi-tasking.
  854. home_assistant_discovery_prefix:
  855. type: string
  856. description: If specified along with MQTT settings, will enable HomeAssistant MQTT discovery using the specified discovery prefix. HomeAssistant's default is `homeassistant/`.
  857. wifi_mode:
  858. type: string
  859. enum:
  860. - B
  861. - G
  862. - N
  863. description: Forces WiFi into the spcified mode. Try using B or G mode if you are having stability issues.
  864. default: N
  865. rf24_channels:
  866. type: array
  867. items:
  868. $ref: '#/components/schemas/RF24Channel'
  869. description: Defines which channels we send on. Each remote type has three channels. We can send on any subset of these.
  870. device_ids:
  871. type: array
  872. items:
  873. $ref: '#/components/schemas/DeviceId'
  874. description:
  875. "List of saved device IDs, stored as 3-long arrays. Elements are: 1) remote ID, 2) remote type, 3) group ID"
  876. example:
  877. - [1234, 'rgb_cct', 1]
  878. - [5678, 'fut089', 5]
  879. gateway_configs:
  880. type: array
  881. items:
  882. type: integer
  883. description: "List of UDP servers, stored as 3-long arrays. Elements are 1) remote ID to bind to, 2) UDP port to listen on, 3) protocol version (5 or 6)"
  884. example:
  885. - [1234, 5555, 6]
  886. group_state_fields:
  887. type: array
  888. items:
  889. $ref: '#/components/schemas/GroupStateField'
  890. group_id_aliases:
  891. type: object
  892. description: Keys are aliases, values are 3-long arrays with same schema as items in `device_ids`.
  893. example:
  894. alias1: [1234, 'rgb_cct', 1]
  895. alias2: [1234, 'rgb_cct', 2]
  896. BooleanResponse:
  897. type: object
  898. required:
  899. - success
  900. properties:
  901. success:
  902. type: boolean
  903. error:
  904. type: string
  905. description: If an error occurred, message specifying what went wrong
  906. About:
  907. type: object
  908. properties:
  909. firmware:
  910. type: string
  911. description: Always set to "milight-hub"
  912. version:
  913. type: string
  914. description: Semver version string
  915. ip_address:
  916. type: string
  917. reset_reason:
  918. type: string
  919. description: Reason the system was last rebooted
  920. variant:
  921. type: string
  922. description: Firmware variant (e.g., d1_mini, nodemcuv2)
  923. free_heap:
  924. type: integer
  925. format: int64
  926. description: Amount of free heap remaining (measured in bytes)
  927. arduino_version:
  928. type: string
  929. description: Version of Arduino SDK firmware was built with
  930. queue_stats:
  931. type: object
  932. properties:
  933. length:
  934. type: integer
  935. description: Number of enqueued packets to be sent
  936. dropped_packets:
  937. type: integer
  938. description: Number of packets that have been dropped since last reboot