# Mini-tutorial Sun-Position Nore-red Mqtt to control shutters based on the sun's position and the month

**URL:** <https://community.gladysassistant.com/t/mini-tuto-sun-position-nore-red-mqtt-pour-piloter-les-volets-en-fonction-de-la-position-du-soleil-et-des-mois/8028>\
**Category:** Tutoriels\
**Tags:** mqtt, node-red\
**Created:** [March 19, 2023, 5:23pm UTC](https://community.gladysassistant.com/t/mini-tuto-sun-position-nore-red-mqtt-pour-piloter-les-volets-en-fonction-de-la-position-du-soleil-et-des-mois/8028 "2023-03-19T17:23:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![cce66](https://gladys-assistant-community.b-cdn.net/letter_avatar_proxy/v4/letter/c/8797f3/32.png) [@cce66](https://community.gladysassistant.com/u/cce66)\
**Post date:** [March 20, 2023, 9:55am UTC](https://community.gladysassistant.com/t/mini-tuto-sun-position-nore-red-mqtt-pour-piloter-les-volets-en-fonction-de-la-position-du-soleil-et-des-mois/8028/3 "2023-03-20T09:55:30Z")

</div>

hi @guim31,

I’ve modified the flow and used the «&nbsp;inject enhanced&nbsp;» which works (the «&nbsp;trigger&nbsp;» doesn’t) and which has the advantage of being able to be configured between sunrise and sunset!  
I’ll look into creating additional nodes in Node-RED to configure the MQTT output based on shutter settings (orientation) and why not the up/down order of Shutter elements in Gladys!  
This should give

If azimuth is between shutter X min AZ value and shutter X max AZ value then  
If altitude is between shutter X min AL value and shutter X max AL value then  
If Winter Month = true then  
Send MQTT Open Shutter X to 100%  
If Summer Month = true then  
Send MQTT Close Shutter X to 100%  
Else  
Send MQTT Open Shutter X to 50%

This should completely cover the gap and allow for significant energy savings

Afterwards I’ll create another mini-tutorial but to couple Gladys, Node-RED, MQTT and my X-4VR shutter modules coupled to my GCE IPX800 V5  
[https://www.gce-electronics.com/fr/carte-relais-ethernet-module-rail-din/1097-ipx800-v4-extension-4-volets-roulants-x-4vr-3760309690094.html](https://www.gce-electronics.com/fr/carte-relais-ethernet-module-rail-din/1097-ipx800-v4-extension-4-volets-roulants-x-4vr-3760309690094.html)

> **[IPX800 V5 – Automate Web sécurisé & évolutif | GCE Electronics](https://gce-electronics.com/fr/accueil/1799-automate-ethernet-ipx800-v5.html)**
>
> Automate IPX800 V5 : serveur HTTPS, scénarios LiveView/Link, MQTT, Philips Hue, API RestFull et nombreuses extensions disponibles.

But I have a bit more work because the MQTT calls had to be modified since the mini-tutorial I had made no longer works (at least for me :! 🙂)

> [@Mini Tuto - Interaction Gladys - IPX800V5 via node-red](https://community.gladysassistant.com/t/mini-tuto-interaction-gladys-ipx800v5-via-node-red/6917):
>
> Le but de ce tuto est de montrer comment piloter des relais de la plate-forme domotique IPX800V5 de GCE avec Gladys Allez dans l’onglet « Système » [image] Cliquez sur « MQTT » [image] Paramétrez comme suit, avec pour « Serveur: " l’ip du broker mosquito (IP du raspberry ou du Nuc sur lequel est installé Gladys, en « Client ID » le nom que vous voudrez (j’ai mis ici IPX800V5 c’est important pour les paramétrage des Topic dans Node-red) [image] Ensuite on va dans l’onglet « Liens » [image…

---

_[View the full topic](https://community.gladysassistant.com/t/mini-tuto-sun-position-nore-red-mqtt-pour-piloter-les-volets-en-fonction-de-la-position-du-soleil-et-des-mois/8028)._
