The companionship sculpture is coming together nicely, which led some room to investigate how to further heighten the user experience. We wanted the lamp to be functional even when the partner lamp was not activated, and at the same time take advantage of some of the cool features that is made possible through Node-RED.
We decided to add a sleep mode to our product. The sleep mode is activated when the sculpture is turned on, but no activation from the partner sculpture is detected. It involves no movement of the sculpture, only light that can be seen through the closed petals. We decided to integrate information from the API Open Weather Map, and visualize the weather in the partner's city through different lighting patterns.
To make this possible we had to figure out how to retrieve data from an API into Node-RED, and to make the city it retrieves data from customizable. The first part turned out to be relatively simple (in retrospect), since there is a customized http node for this purpose.
To solve the second part, we had to divide the url into different segments, and set up the city part of the url so that it’s saved as the payload from a text form in the app interface.
Once the correct data is retrieved from the API, the description of the weather (such as “cloudy”) is sent to the arduino, which then displays different lighting patterns accordingly.
Unfortunately, it turned out in these last few days that it took longer than anticipated to integrate all the code into one working prototype. Therefore, we decided not to incorporate this feature, since it is not a core part of the product, and we wanted the time to make the core functionality work really well. But if we were to develop the product further, we have now developed a good foundation for this feature.