# Reflection on the MQTT API

**URL:** <https://community.gladysassistant.com/t/reflexion-autour-de-lapi-mqtt/5219>\
**Category:** Développement\
**Created:** [February 25, 2020, 1:05pm UTC](https://community.gladysassistant.com/t/reflexion-autour-de-lapi-mqtt/5219 "2020-02-25T13:05:41Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [March 9, 2020, 3:16pm UTC](https://community.gladysassistant.com/t/reflexion-autour-de-lapi-mqtt/5219/10 "2020-03-09T15:16:00Z")

</div>

Hello everyone!

Given that I’m going to Normandy to visit @Terdious next week (who is fully MQTT), and today is my last day of Gladys development before then, I’ve written the spec and started implementing what we discussed in this topic.

The specification:

> <https://github.com/GladysAssistant/Gladys/issues/685>
>
> \*\*Specification\*\*
> 
> \*\*1) Device -\> Gladys\*\*
> 
> \*\*New state from device to Glady…s\*\*
> 
> \`\`\`
> topic: gladys/master/device/:device\_external\_id/feature/:device\_feature\_external\_id/state
> payload: 19.8
> \`\`\`
> 
> \*\*2) Gladys -\> Device\*\*
> 
> \*\*Push state to device\*\*
> 
> \`\`\`
> topic: gladys/device/:device\_external\_id/feature/:device\_feature\_external\_id/state
> payload: 1
> \`\`\`

The PR:

> <https://github.com/GladysAssistant/Gladys/pull/686>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[x\] If your changes affects code, did your write the tests?
> \- \[x\] Are tests passing? (\`npm test\` on both front/server)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[x\] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
> \- \[x\] If you are adding a new features/services which needs explanation, did you modify the user documentation? See \[the GitHub repo\](https://github.com/GladysAssistant/gladys-4-docs) and the \[website\](https://documentation.gladysassistant.com).
> \- \[x\] Did you add fake requests data for the demo mode (\`front/src/config/demo.json\`) so that the demo website is working without a backend? (if needed) See \[https://demo.gladysassistant.com\](https://demo.gladysassistant.com).
> 
> NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
> 
> \### Description of change
> 
> Please provide a description of the change here. It's always best with screenshots, so don't hesitate to add some!

A video demo:

[https://streamable.com/jbnu4](https://streamable.com/jbnu4)

---

_[View the full topic](https://community.gladysassistant.com/t/reflexion-autour-de-lapi-mqtt/5219)._
