openapi.yaml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950
  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. description: 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. description: 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. description: 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. description: 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. description:
  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. description:
  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. description:
  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. description: 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. description:
  227. Patch device state with the specified keys
  228. parameters:
  229. - $ref: '#/components/parameters/BlockOnQueue'
  230. requestBody:
  231. content:
  232. application/json:
  233. schema:
  234. allOf:
  235. - $ref: '#/components/schemas/GroupState'
  236. - $ref: '#/components/schemas/GroupStateCommands'
  237. responses:
  238. 400:
  239. description: error with request
  240. content:
  241. application/json:
  242. schema:
  243. $ref: '#/components/schemas/BooleanResponse'
  244. 200:
  245. description: success
  246. content:
  247. application/json:
  248. schema:
  249. $ref: '#/components/schemas/GroupState'
  250. delete:
  251. tags:
  252. - devices
  253. description:
  254. Delete kept state for given device
  255. responses:
  256. 200:
  257. description: success
  258. content:
  259. application/json:
  260. schema:
  261. $ref: '#/components/schemas/BooleanResponse'
  262. /raw_commands/{remote-type}:
  263. parameters:
  264. - $ref: '#/components/parameters/RemoteType'
  265. post:
  266. tags:
  267. - devices
  268. summary: Send a raw packet
  269. requestBody:
  270. content:
  271. application/json:
  272. schema:
  273. type: object
  274. properties:
  275. packet:
  276. type: string
  277. pattern: "([A-Fa-f0-9]{2}[ ])+"
  278. description: Raw packet to send
  279. example: '01 02 03 04 05 06 07 08 09'
  280. num_repeats:
  281. type: integer
  282. minimum: 1
  283. description: Number of repeated packets to send
  284. example: 50
  285. responses:
  286. 200:
  287. description: success
  288. content:
  289. applicaiton/json:
  290. schema:
  291. $ref: '#/components/schemas/BooleanResponse'
  292. /transitions:
  293. get:
  294. tags:
  295. - transitions
  296. summary: Get all active transitions
  297. responses:
  298. 200:
  299. description: success
  300. content:
  301. application/json:
  302. schema:
  303. type: array
  304. items:
  305. $ref: '#/components/schemas/TransitionData'
  306. post:
  307. tags:
  308. - transitions
  309. summary: Create a new transition
  310. requestBody:
  311. content:
  312. application/json:
  313. schema:
  314. $ref: '#/components/schemas/TransitionData'
  315. responses:
  316. 400:
  317. description: error
  318. content:
  319. application/json:
  320. schema:
  321. $ref: '#/components/schemas/BooleanResponse'
  322. 200:
  323. description: success
  324. content:
  325. application/json:
  326. schema:
  327. $ref: '#/components/schemas/BooleanResponse'
  328. /transitions/{id}:
  329. parameters:
  330. - name: id
  331. in: path
  332. description: ID of transition
  333. schema:
  334. type: integer
  335. required: true
  336. get:
  337. tags:
  338. - transitions
  339. summary: Get properties for provided transition ID
  340. responses:
  341. 404:
  342. description: Provided transition ID not found
  343. 200:
  344. description: success
  345. content:
  346. application/json:
  347. schema:
  348. $ref: '#/components/schemas/TransitionData'
  349. delete:
  350. tags:
  351. - transitions
  352. summary: Delete provided transition
  353. responses:
  354. 404:
  355. description: Provided transition ID not found
  356. content:
  357. application/json:
  358. schema:
  359. $ref: '#/components/schemas/BooleanResponse'
  360. 200:
  361. description: success
  362. content:
  363. application/json:
  364. schema:
  365. $ref: '#/components/schemas/BooleanResponse'
  366. /firmware:
  367. post:
  368. tags:
  369. - system
  370. summary:
  371. Update firmware
  372. requestBody:
  373. description: Firmware file
  374. content:
  375. multipart/form-data:
  376. schema:
  377. type: object
  378. properties:
  379. fileName:
  380. type: string
  381. format: binary
  382. responses:
  383. 200:
  384. description: success
  385. 500:
  386. description: server error
  387. components:
  388. parameters:
  389. DeviceAlias:
  390. name: device-alias
  391. in: path
  392. description: Device alias saved in settings
  393. schema:
  394. type: string
  395. required: true
  396. BlockOnQueue:
  397. name: blockOnQueue
  398. in: query
  399. description: If true, response will block on update packets being sent before returning
  400. schema:
  401. type: boolean
  402. required: false
  403. GroupId:
  404. name: group-id
  405. in: path
  406. description: >
  407. 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.
  408. schema:
  409. type: integer
  410. minimum: 0
  411. maximum: 8
  412. required: true
  413. DeviceId:
  414. name: device-id
  415. in: path
  416. description: 2-byte device ID. Can be decimal or hexadecimal.
  417. schema:
  418. oneOf:
  419. - type: integer
  420. minimum: 0
  421. maximum: 65535
  422. - type: string
  423. pattern: '0x[a-fA-F0-9]+'
  424. example: '0x1234'
  425. required: true
  426. RemoteType:
  427. name: remote-type
  428. in: path
  429. description: Type of remote to read a packet from. If unspecified, will read packets from all remote types.
  430. schema:
  431. $ref: '#/components/schemas/RemoteType'
  432. required: true
  433. schemas:
  434. State:
  435. description: "On/Off state"
  436. type: string
  437. enum:
  438. - On
  439. - Off
  440. example: On
  441. GroupStateCommand:
  442. type: string
  443. enum:
  444. - unpair
  445. - pair
  446. - set_white
  447. - night_mode
  448. - level_up
  449. - level_down
  450. - temperature_up
  451. - temperature_down
  452. - next_mode
  453. - previous_mode
  454. - mode_speed_down
  455. - mode_speed_up
  456. - toggle
  457. example: pair
  458. description: >
  459. Commands that affect a given group. Descriptiosn follow:
  460. * `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.
  461. * `unpair`. Emulates the unpairing process. Send as you connect a paired bulb to have it disassociate with the device ID being used.
  462. * `set_white`. Turns off RGB and enters WW/CW mode.
  463. * `night_mode`. Most devices support a "night mode," which has LEDs turned to a very dim setting -- lower than brightness 0.
  464. * `level_up`. Turns down the brightness. Not all dimmable bulbs support this command.
  465. * `level_down`. Turns down the brightness. Not all dimmable bulbs support this command.
  466. * `temperature_up`. Turns up the white temperature. Not all bulbs with adjustable white temperature support this command.
  467. * `temperature_down`. Turns down the white temperature. Not all bulbs with adjustable white temperature support this command.
  468. * `next_mode`. Cycles to the next "disco mode".
  469. * `previous_mode`. Cycles to the previous disco mode.
  470. * `mode_speed_up`. Turn transition speed for current mode up.
  471. * `mode_speed_down`. Turn transition speed for current mode down.
  472. * `toggle`. Toggle on/off state.
  473. TransitionField:
  474. type: string
  475. enum:
  476. - hue
  477. - saturation
  478. - brightness
  479. - level
  480. - kelvin
  481. - color_temp
  482. - color
  483. example: brightness
  484. TransitionValue:
  485. oneOf:
  486. - type: integer
  487. - type: string
  488. pattern: '[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}'
  489. description: Either an int value or a color
  490. TransitionArgs:
  491. type: object
  492. properties:
  493. field:
  494. $ref: '#/components/schemas/TransitionField'
  495. start_value:
  496. $ref: '#/components/schemas/TransitionValue'
  497. end_value:
  498. $ref: '#/components/schemas/TransitionValue'
  499. duration:
  500. type: number
  501. format: float
  502. description: Duration of transition, measured in seconds
  503. period:
  504. type: integer
  505. description: Length of time between updates in a transition, measured in milliseconds
  506. num_periods:
  507. type: integer
  508. description: Number of packets sent over the course of the transition
  509. TransitionData:
  510. allOf:
  511. - $ref: '#/components/schemas/TransitionArgs'
  512. - type: object
  513. properties:
  514. id:
  515. type: integer
  516. last_sent:
  517. type: integer
  518. description: Timestamp since last update was sent.
  519. bulb:
  520. $ref: '#/components/schemas/BulbId'
  521. type:
  522. type: string
  523. enum:
  524. - field
  525. - color
  526. current_value:
  527. $ref: '#/components/schemas/TransitionValue'
  528. end_value:
  529. $ref: '#/components/schemas/TransitionValue'
  530. BulbId:
  531. type: object
  532. properties:
  533. device_id:
  534. type: integer
  535. minimum: 0
  536. maximum: 65536
  537. example: 1234
  538. group_id:
  539. type: integer
  540. minimum: 0
  541. maximum: 8
  542. example: 1
  543. device_type:
  544. $ref: '#/components/schemas/RemoteType'
  545. GroupStateCommands:
  546. type: object
  547. properties:
  548. command:
  549. oneOf:
  550. - $ref: '#/components/schemas/GroupStateCommand'
  551. - type: object
  552. properties:
  553. command:
  554. type: string
  555. enum:
  556. - transition
  557. args:
  558. $ref: '#/components/schemas/TransitionArgs'
  559. commands:
  560. type: array
  561. items:
  562. $ref: '#/components/schemas/GroupStateCommand'
  563. example:
  564. - level_up
  565. - temperature_up
  566. GroupState:
  567. type: object
  568. properties:
  569. state:
  570. $ref: '#/components/schemas/State'
  571. status:
  572. $ref: '#/components/schemas/State'
  573. hue:
  574. type: integer
  575. minimum: 0
  576. maximum: 359
  577. description: Color hue. Will change bulb to color mode.
  578. saturation:
  579. type: integer
  580. minimum: 0
  581. maximum: 100
  582. description: Color saturation. Will normally change bulb to color mode.
  583. kelvin:
  584. type: integer
  585. minimum: 0
  586. maximum: 100
  587. description: White temperature. 0 is coolest, 100 is warmest.
  588. temperature:
  589. type: integer
  590. minimum: 0
  591. maximum: 100
  592. description: Alias for `kelvin`.
  593. color_temp:
  594. type: integer
  595. minimum: 153
  596. maximum: 370
  597. description: White temperature measured in mireds. Lower values are cooler.
  598. mode:
  599. type: integer
  600. description: Party mode ID. Actual effect depends on the bulb.
  601. color:
  602. oneOf:
  603. - type: string
  604. pattern: '[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}'
  605. - type: object
  606. properties:
  607. r:
  608. type: integer
  609. g:
  610. type: integer
  611. b:
  612. type: integer
  613. example:
  614. '255,0,255'
  615. level:
  616. type: integer
  617. minimum: 0
  618. maximum: 100
  619. description: Brightness on a 0-100 scale.
  620. example: 50
  621. brightness:
  622. type: integer
  623. minimum: 0
  624. maximum: 255
  625. description: Brightness on a 0-255 scale.
  626. example: 170
  627. effect:
  628. type: string
  629. enum:
  630. - night_mode
  631. - white_mode
  632. RemoteType:
  633. type: string
  634. enum:
  635. - "rgbw"
  636. - "cct"
  637. - "rgb_cct"
  638. - "rgb"
  639. - "fut089"
  640. - "fut091"
  641. - "fut020"
  642. example: rgb_cct
  643. RF24Channel:
  644. type: string
  645. enum:
  646. - LOW
  647. - MID
  648. - HIGH
  649. LedMode:
  650. type: string
  651. enum:
  652. - Off
  653. - Slow toggle
  654. - Fast toggle
  655. - Slow blip
  656. - Fast blip
  657. - Flicker
  658. - On
  659. GroupStateField:
  660. type: string
  661. enum:
  662. - state
  663. - status
  664. - brightness
  665. - level
  666. - hue
  667. - saturation
  668. - color
  669. - mode
  670. - kelvin
  671. - color_temp
  672. - bulb_mode
  673. - computed_color
  674. - effect
  675. - device_id
  676. - group_id
  677. - device_type
  678. - oh_color
  679. description: >
  680. Defines a field which is a part of state for a particular light device. Most fields are self-explanatory, but documentation for each follows:
  681. * `state` / `status` - same value with different keys (useful if your platform expects one or the other).
  682. * `brightness` / `level` - [0, 255] and [0, 100] scales of the same value.
  683. * `kelvin / color_temp` - [0, 100] and [153, 370] scales for the same value. The later's unit is mireds.
  684. * `bulb_mode` - what mode the bulb is in: white, rgb, etc.
  685. * `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.
  686. * `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).
  687. * `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.
  688. DeviceId:
  689. type: array
  690. items: {}
  691. example:
  692. - 1234
  693. - "rgb_cct"
  694. - 1
  695. Settings:
  696. type: object
  697. properties:
  698. admin_username:
  699. type: string
  700. description: If spcified along with `admin_password`, HTTP basic auth will be enabled to access all REST endpoints.
  701. default: ""
  702. admin_password:
  703. type: string
  704. description: If spcified along with `admin_username`, HTTP basic auth will be enabled to access all REST endpoints.
  705. default: ""
  706. ce_pin:
  707. type: integer
  708. description: CE pin to use for SPI radio (nRF24, LT8900)
  709. default: 4
  710. csn_pin:
  711. type: integer
  712. description: CSN pin to use with nRF24
  713. default: 15
  714. reset_pin:
  715. type: integer
  716. description: Reset pin to use with LT8900
  717. default: 0
  718. led_pin:
  719. type: integer
  720. description: Pin to control for status LED. Set to a negative value to invert on/off status.
  721. default: -2
  722. packet_repeats:
  723. type: integer
  724. description: Number of times to resend the same 2.4 GHz milight packet when a command is sent.
  725. default: 50
  726. http_repeat_factor:
  727. type: integer
  728. description: Packet repeats resulting from REST commands will be multiplied by this number.
  729. default: 1
  730. auto_restart_period:
  731. type: integer
  732. description: Automatically restart the device after the number of specified minutes. Use 0 to disable.
  733. default: 0
  734. mqtt_server:
  735. type: string
  736. description: MQTT server to connect to.
  737. format: hostname
  738. mqtt_username:
  739. type: string
  740. description: If specified, use this username to authenticate with the MQTT server.
  741. mqtt_password:
  742. type: string
  743. description: If specified, use this password to authenticate with the MQTT server.
  744. mqtt_topic_pattern:
  745. type: string
  746. description: Topic pattern to listen on for commands. More detail on the format in README.
  747. example: milight/commands/:device_id/:device_type/:group_id
  748. mqtt_update_topic_pattern:
  749. type: string
  750. description: Topic pattern individual intercepted commands will be sent to. More detail on the format in README.
  751. example: milight/updates/:device_id/:device_type/:group_id
  752. mqtt_update_state_pattern:
  753. type: string
  754. description: Topic pattern device state will be sent to. More detail on the format in README.
  755. example: milight/state/:device_id/:device_type/:group_id
  756. mqtt_client_status_topic:
  757. type: string
  758. description: Topic client status will be sent to.
  759. example: milight/status
  760. simple_mqtt_client_status:
  761. type: boolean
  762. 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.
  763. default: true
  764. discovery_port:
  765. type: integer
  766. description: UDP discovery port
  767. default: 48899
  768. listen_repeats:
  769. type: integer
  770. description: Controls how many cycles are spent listening for packets. Set to 0 to disable passive listening.
  771. default: 3
  772. state_flush_interval:
  773. type: integer
  774. description: Controls how many miliseconds must pass between states being flushed to persistent storage. Set to 0 to disable throttling.
  775. default: 10000
  776. mqtt_state_rate_limit:
  777. type: integer
  778. description: Controls how many miliseconds must pass between MQTT state updates. Set to 0 to disable throttling.
  779. default: 500
  780. packet_repeat_throttle_threshold:
  781. type: integer
  782. description:
  783. 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.
  784. default: 200
  785. packet_repeat_throttle_sensitivity:
  786. type: integer
  787. description:
  788. Controls how packet repeats are throttled. Higher values cause packets to be throttled up and down faster. Set to 0 to disable throttling.
  789. default: 0
  790. minimum: 0
  791. maximum: 1000
  792. packet_repeat_minimum:
  793. type: integer
  794. description:
  795. Controls how far throttling can decrease the number of repeated packets
  796. default: 3
  797. enable_automatic_mode_switching:
  798. type: boolean
  799. description:
  800. 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.
  801. default: false
  802. led_mode_wifi_config:
  803. $ref: '#/components/schemas/LedMode'
  804. led_mode_wifi_failed:
  805. $ref: '#/components/schemas/LedMode'
  806. led_mode_operating:
  807. $ref: '#/components/schemas/LedMode'
  808. led_mode_packet:
  809. $ref: '#/components/schemas/LedMode'
  810. led_mode_packet_count:
  811. type: integer
  812. description: Number of times the LED will flash when packets are changing
  813. default: 3
  814. hostname:
  815. type: string
  816. description: Hostname that will be advertized on a DHCP request
  817. pattern: "[a-zA-Z0-9-]+"
  818. default: milight-hub
  819. rf24_power_level:
  820. type: string
  821. enum:
  822. - MIN
  823. - LOW
  824. - HIGH
  825. - MAX
  826. description: Power level used when packets are sent. See nRF24 documentation for further detail.
  827. default: MAX
  828. rf24_listen_channel:
  829. $ref: '#/components/schemas/RF24Channel'
  830. wifi_static_ip:
  831. type: string
  832. format: ipv4
  833. description: If specified, the static IP address to use
  834. wifi_static_ip_gateway:
  835. type: string
  836. format: ipv4
  837. description: If specified along with static IP, the gateway address to use
  838. wifi_static_ip_netmask:
  839. type: string
  840. format: ipv4
  841. description: If specified along with static IP, the netmask to use
  842. packet_repeats_per_loop:
  843. type: integer
  844. default: 10
  845. 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.
  846. home_assistant_discovery_prefix:
  847. type: string
  848. description: If specified along with MQTT settings, will enable HomeAssistant MQTT discovery using the specified discovery prefix. HomeAssistant's default is `homeassistant/`.
  849. wifi_mode:
  850. type: string
  851. enum:
  852. - B
  853. - G
  854. - N
  855. description: Forces WiFi into the spcified mode. Try using B or G mode if you are having stability issues.
  856. default: N
  857. rf24_channels:
  858. type: array
  859. items:
  860. $ref: '#/components/schemas/RF24Channel'
  861. description: Defines which channels we send on. Each remote type has three channels. We can send on any subset of these.
  862. device_ids:
  863. type: array
  864. items:
  865. $ref: '#/components/schemas/DeviceId'
  866. description:
  867. "List of saved device IDs, stored as 3-long arrays. Elements are: 1) remote ID, 2) remote type, 3) group ID"
  868. example:
  869. - [1234, 'rgb_cct', 1]
  870. - [5678, 'fut089', 5]
  871. gateway_configs:
  872. type: array
  873. items:
  874. type: integer
  875. 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)"
  876. example:
  877. - [1234, 5555, 6]
  878. group_state_fields:
  879. type: array
  880. items:
  881. $ref: '#/components/schemas/GroupStateField'
  882. group_id_aliases:
  883. type: object
  884. description: Keys are aliases, values are 3-long arrays with same schema as items in `device_ids`.
  885. example:
  886. alias1: [1234, 'rgb_cct', 1]
  887. alias2: [1234, 'rgb_cct', 2]
  888. BooleanResponse:
  889. type: object
  890. required:
  891. - success
  892. properties:
  893. success:
  894. type: boolean
  895. error:
  896. type: string
  897. description: If an error occurred, message specifying what went wrong
  898. About:
  899. type: object
  900. properties:
  901. firmware:
  902. type: string
  903. description: Always set to "milight-hub"
  904. version:
  905. type: string
  906. description: Semver version string
  907. ip_address:
  908. type: string
  909. reset_reason:
  910. type: string
  911. description: Reason the system was last rebooted
  912. variant:
  913. type: string
  914. description: Firmware variant (e.g., d1_mini, nodemcuv2)
  915. free_heap:
  916. type: integer
  917. format: int64
  918. description: Amount of free heap remaining (measured in bytes)
  919. arduino_version:
  920. type: string
  921. description: Version of Arduino SDK firmware was built with
  922. queue_stats:
  923. type: object
  924. properties:
  925. length:
  926. type: integer
  927. description: Number of enqueued packets to be sent
  928. dropped_packets:
  929. type: integer
  930. description: Number of packets that have been dropped since last reboot