Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7940e504e4 | |||
| a07a30c483 | |||
| 52585d8088 | |||
| 048a9380b9 | |||
| ca255317f6 | |||
| 0eeec51bb0 | |||
| aa4e7fa5c8 | |||
| b3e74ab9b1 | |||
| 99394f8672 | |||
| 2ab8a2591d | |||
| a613b8c978 | |||
| fa31f97c47 | |||
| 1d2a6f9237 | |||
| 443f266296 | |||
| 589806d0fd | |||
| f1d638c064 | |||
| 191251f71b | |||
| 6867d1021b | |||
| 7fa5cd847c | |||
| e5c0e8de97 | |||
| 3000a9e98d | |||
| ae21907558 | |||
| 0927c4ff5e | |||
| cb2cb3db9b | |||
| fcc1f49cf0 | |||
| 2d17b93f29 | |||
| a596203a6b | |||
| d7d35fa401 | |||
| bfe5cea7b4 | |||
| 7b5c3b7dd5 | |||
| 9d7c7bd981 | |||
| 82e1063801 | |||
| dc076f96cb | |||
| 7c0bc690e8 | |||
| 006a66bed4 |
@@ -747,7 +747,7 @@ void loop() {
|
|||||||
#endif
|
#endif
|
||||||
#if defined(ENABLE_HOMEASSISTANT)
|
#if defined(ENABLE_HOMEASSISTANT)
|
||||||
if(ha_send_data.active()) ha_send_data.detach();
|
if(ha_send_data.active()) ha_send_data.detach();
|
||||||
ha_send_data.once(5, tickerSendState);
|
ha_send_data.once(DELAY_MQTT_HA_MESSAGE, tickerSendState);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ char HOSTNAME[65] = "McLightingRGBW"; // Friedly hostname is configurable just
|
|||||||
//#define ENABLE_MQTT_INCLUDE_IP // uncomment/comment to add the IP-adress to the MQTT message
|
//#define ENABLE_MQTT_INCLUDE_IP // uncomment/comment to add the IP-adress to the MQTT message
|
||||||
#define ENABLE_HOMEASSISTANT // If defined, enable Homeassistant integration, ENABLE_MQTT must be active
|
#define ENABLE_HOMEASSISTANT // If defined, enable Homeassistant integration, ENABLE_MQTT must be active
|
||||||
#define MQTT_HOME_ASSISTANT_SUPPORT // If defined, use AMQTT and select Tools -> IwIP Variant -> Higher Bandwidth
|
#define MQTT_HOME_ASSISTANT_SUPPORT // If defined, use AMQTT and select Tools -> IwIP Variant -> Higher Bandwidth
|
||||||
//#define DISABLE_MQTT_OUT_ON_MQTT_IN // If defined, McLighting will not send back MQTT-out on MQTT-in regarding issue #67, does not change anything at the moment
|
#define DELAY_MQTT_HA_MESSAGE 5 // HA Status is send after DELAY_MQTT_HA_MESSAGE seconds, to save bandwith
|
||||||
|
|
||||||
//#define ENABLE_BUTTON 14 // If defined, enable button handling code, see: https://github.com/toblum/McLighting/wiki/Button-control, the value defines the input pin (14 / D5) for switching the LED strip on / off, connect this PIN to ground to trigger button.
|
//#define ENABLE_BUTTON 14 // If defined, enable button handling code, see: https://github.com/toblum/McLighting/wiki/Button-control, the value defines the input pin (14 / D5) for switching the LED strip on / off, connect this PIN to ground to trigger button.
|
||||||
//#define ENABLE_BUTTON_GY33 12 // If defined, enable button handling code for GY-33 color sensor to scan color. The value defines the input pin (12 / D6) for read color data with RGB sensor, connect this PIN to ground to trigger button.
|
//#define ENABLE_BUTTON_GY33 12 // If defined, enable button handling code for GY-33 color sensor to scan color. The value defines the input pin (12 / D6) for read color data with RGB sensor, connect this PIN to ground to trigger button.
|
||||||
@@ -178,10 +178,10 @@ struct {
|
|||||||
uint8_t pin = 3;
|
uint8_t pin = 3;
|
||||||
#endif
|
#endif
|
||||||
#if USE_WS2812FX_DMA == 1
|
#if USE_WS2812FX_DMA == 1
|
||||||
uint8_t pin = 2;
|
uint8_t pin = 1;
|
||||||
#endif
|
#endif
|
||||||
#if USE_WS2812FX_DMA == 2
|
#if USE_WS2812FX_DMA == 2
|
||||||
uint8_t pin = 1;
|
uint8_t pin = 2;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
uint8_t pin = LED_PIN;
|
uint8_t pin = LED_PIN;
|
||||||
|
|||||||
@@ -743,11 +743,15 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||||||
root["effect"] = strip->getModeName(strip->getMode());
|
root["effect"] = strip->getModeName(strip->getMode());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
char buffer[measureJson(root) + 1];
|
uint16_t msg_len = measureJson(root) + 1;
|
||||||
|
char buffer[msg_len];
|
||||||
serializeJson(root, buffer, sizeof(buffer));
|
serializeJson(root, buffer, sizeof(buffer));
|
||||||
jsonBuffer.clear();
|
jsonBuffer.clear();
|
||||||
#if ENABLE_MQTT == 0
|
#if ENABLE_MQTT == 0
|
||||||
mqtt_client->publish(mqtt_ha_state_out, buffer, true);
|
//mqtt_client->publish(mqtt_ha_state_out, buffer, true);
|
||||||
|
mqtt_client->beginPublish(mqtt_ha_state_out, msg_len-1, true);
|
||||||
|
mqtt_client->write((const uint8_t*)buffer, msg_len-1);
|
||||||
|
mqtt_client->endPublish();
|
||||||
DBG_OUTPUT_PORT.printf("MQTT: Send [%s]: %s\r\n", mqtt_ha_state_out, buffer);
|
DBG_OUTPUT_PORT.printf("MQTT: Send [%s]: %s\r\n", mqtt_ha_state_out, buffer);
|
||||||
#endif
|
#endif
|
||||||
#if ENABLE_MQTT == 1
|
#if ENABLE_MQTT == 1
|
||||||
@@ -901,7 +905,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(ha_send_data.active()) ha_send_data.detach();
|
if(ha_send_data.active()) ha_send_data.detach();
|
||||||
ha_send_data.once(5, tickerSendState);
|
ha_send_data.once(DELAY_MQTT_HA_MESSAGE, tickerSendState);
|
||||||
} else if (strcmp(topic, mqtt_intopic) == 0) {
|
} else if (strcmp(topic, mqtt_intopic) == 0) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -936,7 +940,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t lenght
|
|||||||
#if defined(ENABLE_HOMEASSISTANT)
|
#if defined(ENABLE_HOMEASSISTANT)
|
||||||
ha_send_data.detach();
|
ha_send_data.detach();
|
||||||
mqtt_client->subscribe(mqtt_ha_state_in, qossub);
|
mqtt_client->subscribe(mqtt_ha_state_in, qossub);
|
||||||
ha_send_data.once(5, tickerSendState);
|
ha_send_data.once(DELAY_MQTT_HA_MESSAGE, tickerSendState);
|
||||||
#if defined(MQTT_HOME_ASSISTANT_SUPPORT)
|
#if defined(MQTT_HOME_ASSISTANT_SUPPORT)
|
||||||
const size_t bufferSize = JSON_ARRAY_SIZE(strip->getModeCount()+ 4) + JSON_OBJECT_SIZE(11) + 1500;
|
const size_t bufferSize = JSON_ARRAY_SIZE(strip->getModeCount()+ 4) + JSON_OBJECT_SIZE(11) + 1500;
|
||||||
DynamicJsonDocument jsonBuffer(bufferSize);
|
DynamicJsonDocument jsonBuffer(bufferSize);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define SKETCH_VERSION "3.1.0"
|
#define SKETCH_VERSION "3.1.1"
|
||||||
@@ -257,4 +257,8 @@
|
|||||||
* Version Bump to 3.1.0
|
* Version Bump to 3.1.0
|
||||||
* bugfixes
|
* bugfixes
|
||||||
* E1.31 is now working for multi segments
|
* E1.31 is now working for multi segments
|
||||||
|
*
|
||||||
|
* 18 April 2020
|
||||||
|
* Version Bump to 3.1.1
|
||||||
|
* bugfixes regarding issue #80
|
||||||
*/
|
*/
|
||||||
@@ -37,17 +37,17 @@ This project uses libraries and code by different authors:
|
|||||||
|
|
||||||
- [WS2812FX](https://github.com/kitesurfer1404/WS2812FX) by kitesurfer1404 (tested with version 1.2.1)
|
- [WS2812FX](https://github.com/kitesurfer1404/WS2812FX) by kitesurfer1404 (tested with version 1.2.1)
|
||||||
|
|
||||||
- [WebSockets](https://github.com/Links2004/arduinoWebSockets) by Links2004 (tested with version 2.1.4)
|
- [WebSockets](https://github.com/Links2004/arduinoWebSockets) by Links2004 (tested with version 2.2.0)
|
||||||
|
|
||||||
- [Adafruit NeoPixel](https://github.com/adafruit/Adafruit_NeoPixel) by adafruit (tested with 1.2.5)
|
- [Adafruit NeoPixel](https://github.com/adafruit/Adafruit_NeoPixel) by adafruit (tested with 1.4.0)
|
||||||
|
|
||||||
- Optional: [PubSubClient](https://github.com/knolleary/pubsubclient/) by knolleary (tested with 2.7.0)
|
- Optional: [PubSubClient](https://github.com/knolleary/pubsubclient/) by knolleary (tested with 2.8.0)
|
||||||
_Only when you have activated MQTT in definitions.h._
|
_Only when you have activated MQTT in definitions.h._
|
||||||
|
|
||||||
- Optional: [Brzo I2C](https://github.com/pasko-zh/brzo_i2c/) by pazko-zh (tested with 1.3.3)
|
- Optional: [Brzo I2C](https://github.com/pasko-zh/brzo_i2c/) by pazko-zh (tested with 1.3.3)
|
||||||
_Only when you have activated GY33 in definitions.h._
|
_Only when you have activated GY33 in definitions.h._
|
||||||
|
|
||||||
- Optional: [FastLed](https://github.com/FastLED/FastLED/) by FastLED (tested with 1.3.3)
|
- Optional: [FastLed](https://github.com/FastLED/FastLED/) by FastLED (tested with 3.3.3)
|
||||||
_Only when you have activated custom animations (Fire2012) in definitions.h._
|
_Only when you have activated custom animations (Fire2012) in definitions.h._
|
||||||
|
|
||||||
The sketch also uses the following built-in library:
|
The sketch also uses the following built-in library:
|
||||||
@@ -66,7 +66,7 @@ I hope I didn't miss any sources and mentioned every author. In case I forgot so
|
|||||||
|
|
||||||
|
|
||||||
## Todos
|
## Todos
|
||||||
- [ ] Redesign of Code and bump to V3
|
- [x] Redesign of Code and bump to V3
|
||||||
- [ ] Customer profile to define segments of (in)active areas on the strip [Issue](https://github.com/toblum/McLighting/issues/37)
|
- [ ] Customer profile to define segments of (in)active areas on the strip [Issue](https://github.com/toblum/McLighting/issues/37)
|
||||||
- [ ] Additional clients
|
- [ ] Additional clients
|
||||||
- [x] If no wifi, at least enable button mode.
|
- [x] If no wifi, at least enable button mode.
|
||||||
|
|||||||
Reference in New Issue
Block a user