Czesc,
mam jeszcze drobny problem z tym licznikiem - nieaktulalizuje popranie (chyba) danych dla mqtt. Na telefonie wyglada ok, wiec gdzies zaczytuje biezaca produkcje. Wyglada to tak:
Code: Select all
mosquitto_sub -h localhost -u supla -P haslohaslo -t supla/channels/status/electricity/245
{"id": 245, "currency":"PLN", "online": 1, "pricePerUnit": 0.650000, "totalCost": 2206.620000, "phases": [ {"number":$number_0$, "frequency": $frequency_0$, "voltage": $voltage_0$, "current": $current_0$, "powerActive":$powerActive_0$, "powerReactive": $powerReactive_0$, "powerApparent": $powerApparent_0$, "powerFactor": $powerFactor_0$, "phaseAngle": $phaseAngle_0$, "totalForwardActiveEnergy": $totalForwardActiveEnergy_0$, "totalReverseActiveEnergy": $totalReverseActiveEnergy_0$, "totalForwardReactiveEnergy":$totalForwardReactiveEnergy_0$, "totalReverseReactiveEnergy":$totalReverseReactiveEnergy_0$ }, {"number":$number_1$, "frequency": $frequency_1$, "voltage": $voltage_1$, "current": $current_1$, "powerActive":$powerActive_1$, "powerReactive": $powerReactive_1$, "powerApparent": $powerApparent_1$, "powerFactor": $powerFactor_1$, "phaseAngle": $phaseAngle_1$, "totalForwardActiveEnergy": $totalForwardActiveEnergy_1$, "totalReverseActiveEnergy": $totalReverseActiveEnergy_1$, "totalForwardReactiveEnergy":$totalForwardReactiveEnergy_1$, "totalReverseReactiveEnergy":$totalReverseReactiveEnergy_1$ }, {"number":$number_2$, "frequency": $frequency_2$, "voltage": $voltage_2$, "current": $current_2$, "powerActive":$powerActive_2$, "powerReactive": $powerReactive_2$, "powerApparent": $powerApparent_2$, "powerFactor": $powerFactor_2$, "phaseAngle": $phaseAngle_2$, "totalForwardActiveEnergy": $totalForwardActiveEnergy_2$, "totalReverseActiveEnergy": $totalReverseActiveEnergy_2$, "totalForwardReactiveEnergy":$totalForwardReactiveEnergy_2$, "totalReverseReactiveEnergy":$totalReverseReactiveEnergy_2$ } ]}
Wszystkie zmienne $.*$ sa niepodmienione przez wartosci.w client_publisher.cpp jest petla na 3 fazy, i sprawdza czy napiecie >0 to wtedy podmienia. wywalilem tego ifa, i juz podmienial, ale na 0 :/