Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. revenkopa

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 9
    • Best 0
    • Groups 0

    revenkopa

    @revenkopa

    0
    Reputation
    7
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    revenkopa Follow

    Latest posts made by revenkopa

    • IoBroker.mobile

      как работать ?

      есть возможность руками пока интерфейс забить ?

      posted in ioBroker.vis Драйвер
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      Вот точно такая же фигня была :

      Раньше такая строка отправлялась от брокера: myhome/Bedroom/Servo

      Сейчас: mqtt/0/myhome/Bedroom/Servo

      только не помогает ранее найденое лекарство - строка префикса и так пустая

      posted in ioBroker драйвера
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      Вот код :

      ! #include <dht.h>#include <esp8266wifi.h>#include <pubsubclient.h>#define DHTPIN 5
      ! //#define DHTTYPE DHT11 // DHT 11
      ! #define DHTTYPE DHT22 // DHT 22 (AM2302)
      ! //#define DHTTYPE DHT21 // DHT 21 (AM2301)
      ! float dht_h ; // Reading temperature or humidity takes about 250 milliseconds!
      ! float dht_t ; // Read temperature as Celsius (the default)
      ! DHT dht(DHTPIN, DHTTYPE);
      ! #define Rel1pin 12
      ! #define Rel2pin 13
      ! #define But1pin 4
      ! #define But2pin 6
      ! // Update these with values suitable for your network.
      ! const char* ssid = "kv7";
      ! const char* password = "*****";
      ! //const char
      mqtt_server = "broker.mqtt-dashboard.com";
      ! IPAddress MQTTserver(192, 168, 1, 120);
      ! String MQTT_CN = "kv7/Kitchen/1";
      ! IPAddress IPAdrr (192, 168, 1, 201);
      ! IPAddress IPGW (192, 168, 1, 1);
      ! IPAddress Mask (255, 255, 255, 0);
      ! unsigned long TimerSendTH = 0;
      ! unsigned long TimerSendTHOFF = 2000;
      ! unsigned long TimerRel1 = 0;
      ! unsigned long TimerRel1OFF = 5000;
      ! unsigned long TimerRel2 = 0;
      ! unsigned long TimerRel2OFF = 6000;
      ! WiFiClient espClient;
      ! PubSubClient client(espClient);
      ! long lastMsg = 0;
      ! char msg[50];
      ! int value = 0;
      ! void setup() {
      ! pinMode(BUILTIN_LED, OUTPUT); // Initialize the BUILTIN_LED pin as an output
      ! pinMode(12, OUTPUT);
      ! pinMode(13, OUTPUT);
      ! pinMode( 4, INPUT);
      ! dht.begin();
      ! Serial.begin(115200);
      ! WiFi.begin(ssid, password);
      ! WiFi.config(IPAdrr, IPGW, Mask ); //Comment for DHCP
      ! setup_wifi();
      ! client.setServer(MQTTserver, 1883);
      ! client.setCallback(callback);
      ! }
      ! void setup_wifi() {
      ! delay(10);
      ! // We start by connecting to a WiFi network
      ! Serial.println();
      ! Serial.print("Connecting to ");
      ! Serial.println(ssid);
      ! // WiFi.begin(ssid, password);
      ! while (WiFi.status() != WL_CONNECTED) {
      ! delay(500);
      ! Serial.print(".");
      ! }
      ! Serial.println("");
      ! Serial.println("WiFi connected");
      ! Serial.println("IP address: ");
      ! Serial.println(WiFi.localIP());
      ! }
      ! void callback(char
      topic, byte
      payload, unsigned int length) {
      ! payload[length] = '\0';
      ! String strTopic = String(topic);
      ! strTopic.replace(MQTT_CN,"");
      ! String strPayload = String((char
      )payload);
      ! Serial.print("Message arrived [");
      ! Serial.print(strTopic+" | ");
      ! Serial.print(strPayload);
      ! Serial.print("]");
      ! Serial.println("");
      ! if (strTopic == "/Rel1") {
      ! if (strPayload == "0") digitalWrite(Rel1pin, !LOW);
      ! else if (strPayload == "1") digitalWrite(Rel1pin, !HIGH);
      ! }
      ! else if (strTopic == "/Rel2") {
      ! if (strPayload == "0") digitalWrite(Rel2pin, !LOW);
      ! else if (strPayload == "1") digitalWrite(Rel2pin, !HIGH);
      ! }
      ! }
      ! boolean reconnect() {
      ! Serial.print("Attempting MQTT connection…");
      ! // if (client.connect(("Controller "+MQTT_CN).c_str() ))
      ! if (client.connect("Controller 1"))
      ! {
      ! // Once connected, publish an announcement...
      ! client.publish(MQTT_CN.c_str() ," online");
      ! // ... and resubscribe
      ! Serial.print("Subscribe...ok "+MQTT_CN);
      ! client.subscribe((MQTT_CN+"/#").c_str() );
      ! }
      ! else Serial.print("Fail...");
      ! return client.connected();
      ! }
      ! boolean measurements() {
      ! Serial.print("measurements... ");
      ! dht_h = dht.readHumidity();
      ! dht_t = dht.readTemperature();
      ! if (isnan(dht_h) || isnan(dht_t) || isnan(dht.readTemperature(true))) return false;
      ! return true;
      ! }
      ! void loop() {
      ! if (!client.connected()) reconnect();
      ! client.loop();
      ! // digitalWrite(12, !digitalRead(4) );
      ! // digitalWrite(13, !digitalRead(4) );
      ! // TimerSendTH = 0;
      ! //TimerSendTHOFF = 2000;
      ! // TimerRel1 = 0;
      ! // TimerRel1OFF = 5000;
      ! // TimerRel2 = 0;
      ! // TimerRel2OFF = 6000;
      ! //measurements();
      ! //snprintf (msg, 75, "%2d", DHT.humidity);
      ! dtostrf (dht_h,0,2,msg );
      ! // client.publish((MQTT_CN+ "/humidity").c_str(), msg);
      ! // Serial.println(dht_h);
      ! dtostrf ( dht_t,0,2,msg );
      ! // client.publish((MQTT_CN+"/temperature").c_str(), msg);
      ! // Serial.println(dht_t);
      ! client.publish((MQTT_CN+"/Rel1").c_str(),String( !digitalRead(12)).c_str());
      ! Serial.println((MQTT_CN+"/Rel1"+String( !digitalRead(12))).c_str() );
      ! delay(500);
      ! client.publish((MQTT_CN+"/Rel2").c_str(),String( !digitalRead(13)).c_str());
      ! Serial.println((MQTT_CN+"/Rel2"+String( !digitalRead(13))).c_str() );
      ! delay(500);
      ! }</pubsubclient.h></esp8266wifi.h></dht.h>

      posted in ioBroker драйвера
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      я имею ввиду что до версии драйвера MQTT Adapter 2.15 паблики исходящих сообщений имели вид

      "myhome/Mother/DomofonOpen"

      и это меня устраивало и с точки зрения чистоты кода, и с точки зрения применяемости полученного конечного устройства (параллельно смотрю мажордомо)

      после версии драйвера MQTT Adapter 2.15 паблики исходящих сообщений стали

      "mqtt/0/myhome/Mother/DomofonOpen"

      и это меня не устраивает а отключить не нашел как

      обходные пути я вижу но они меня не устраивают

      поэтому вопросы :

      • это глюк при переходе ?

      • есть возможность отключить ?

      ну и старые никем не отвеченные :

      • Можно ли организовать работу с одной переменной (без IN и OUT) ?

      • У меня контролер ловит свои же сообщения и отрабатывает …. это глюк или все как положено?

      • как в iobroker организовать работу когда лампочка в vis отображает значение пришедшее в OUT а управляющий надо посылать в IN ?

      posted in ioBroker драйвера
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      по протоколу MQTT топики выглядят так mqtt/0/kv7/kitchen/1/rel1

      posted in ioBroker драйвера
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      а сообщения из иоброкера выглядят так

      mqtt/0/kv7/kitchen/1/rel1

      и mqtt/0 малину портит

      posted in ioBroker драйвера
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      чтобы меньше в ардуино писать 😄

      posted in ioBroker драйвера
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      кстати как убрать приставку из топика "mqtt.0." которую обязательно стал добавлять mqqt driver iobroker

      posted in ioBroker драйвера
      R
      revenkopa
    • RE: Драйвер Mqtt + Arduino

      Можно ли организовать работу с одной переменной (без IN и OUT) ? У меня контролер ловит свои же сообщения и отрабатывает …. это глюк или все как положено ?

      как в iobroker организовать работу когда лампочка в vis отображает значение пришедшее в OUT а упровляющий надо посылать в IN ?
      5076_2018_09_21_19_35_19_window.png

      posted in ioBroker драйвера
      R
      revenkopa
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo