I have imported rule and dashboard from the tutorial and when i send data to device the table sometime only shows data for counter, other times only for delta and others it just works.
TB 2.0 docker in ubuntu 16
Could you please share screenshot of the table with not correct data
Screenshot:

I've just reverified this tutorial on the latest master version. It works as expected.
Could you also share script (or command) that you are using for uploading telemetry?
Is it only for 1 device or there are many devices?
It's only for one device, i used same python script shared in github issue
Tested in TB 2.0.1 and still not working correctly.
my script:
import paho.mqtt.client as mqtt
from time import sleep
import random
topic_pub='v1/devices/me/telemetry'
client = mqtt.Client()
SMART_ENERGY_ACCESS_TOKEN="Ml30QBKFIzxgx4JuLm1G"
client.username_pw_set(SMART_ENERGY_ACCESS_TOKEN)
client.connect('127.0.0.1', 1883, 1)
# 1883
y = 0
while True:
x = random.randrange(0, 6)
y += x
print(y)
msg = '{"counter":"'+ str(y) + '"}'
client.publish(topic_pub, msg)
sleep(1)

@untilbit your script pushes data as strings and not integers. Maybe this is related.
Do you have an example? I tried changes to integer but message cannot be sent if it's not a string.
msg = '{"counter":'+ str(y) + '}'
@gustavovelascoh before i was sending it as a string and now i want to send the number as an integer but the pyhthon script doesn't allow it.
What exception does it throw? Post the output you get from the python script.
Error:
Traceback (most recent call last):
File "send-telemetry.py", line 21, in <module>
msg = '{"counter":'+ y + '}'
TypeError: must be str, not int
Take a look:
msg = '{"counter":'+ str(y) + '}' is different to msg = '{"counter":'+ y + '}'
You must convert integer y to string to concatenate its value to the rest of the JSON string, but don't use double quotes around the value.
This is what you had msg = '{"counter":"'+ str(y) + '"}', and generates '{"counter": "VALUE"}'.
This is what I posted before msg = '{"counter":'+ str(y) + '}', and generates '{"counter": VALUE}'.
def publish_telemetry(name, value):
try:
data = {}
data[name] = value
publish(TOPIC_TELEMETRY, json.dumps(data))
except Exception as e:
log("publish_telemetry::" + str(e))
On Tue, Jun 5, 2018 at 1:00 PM, Untilbit notifications@github.com wrote:
Error:
Traceback (most recent call last):
File "send-telemetry.py", line 21, in
msg = '{"counter":'+ y + '}'
TypeError: must be str, not int—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/thingsboard/thingsboard/issues/826#issuecomment-394668027,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADBHxN0XOtlOvQ-DGRvxwznnbbNm3q1nks5t5mTCgaJpZM4UWd1W
.
--
Merci beaucoup, Muito obrigado, Thanks
Carlos TangerinoMobile: +33 6 82 05 55 18
@gustavovelascoh @Tangerino @ashvayka Thanks very much.
This is the working script:
import paho.mqtt.client as mqtt
from time import sleep
import random, json
TOPIC_TELEMETRY='v1/devices/me/telemetry'
SMART_ENERGY_ACCESS_TOKEN="EzouNvJ2iyeDKleuCytL"
client = mqtt.Client()
client.username_pw_set(SMART_ENERGY_ACCESS_TOKEN)
client.connect('127.0.0.1', 1883, 1)
def publish_telemetry(name, value):
try:
data = {}
data[name] = value
client.publish(TOPIC_TELEMETRY, json.dumps(data))
except Exception as e:
print("publish_telemetry::" + str(e))
n = 0
value = 0
while n != 1000:
randomNumber = random.randrange(0, 6)
value += randomNumber
n += 1
print(value)
publish_telemetry('counter', value)
sleep(1)
Final result:


Please do not share your secret tokens!!!
Carlos
On Tue, Jun 5, 2018 at 3:42 PM Untilbit notifications@github.com wrote:
@gustavovelascoh https://github.com/gustavovelascoh @Tangerino
https://github.com/Tangerino Thanks very much.This is the working script:
import paho.mqtt.client as mqtt
from time import sleep
import random, jsonTOPIC_TELEMETRY='v1/devices/me/telemetry'
SMART_ENERGY_ACCESS_TOKEN="EzouNvJ2iyeDKleuCytL"client = mqtt.Client()
client.username_pw_set(SMART_ENERGY_ACCESS_TOKEN)
client.connect('mycircutor-dev-01.westeurope.cloudapp.azure.com', 1883, 1)def publish_telemetry(name, value):
try:
data = {}
data[name] = value
client.publish(TOPIC_TELEMETRY, json.dumps(data))
except Exception as e:
print("publish_telemetry::" + str(e))n = 0
value = 0
while n != 1000:
randomNumber = random.randrange(0, 6)
value += randomNumber
n += 1
print(value)
publish_telemetry('counter', value)
sleep(1)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/thingsboard/thingsboard/issues/826#issuecomment-394713446,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADBHxEFdaGoLZccu1IIuuspf6mFGhlfoks5t5orAgaJpZM4UWd1W
.
--
Merci beaucoup, Muito obrigado, Thanks
Carlos TangerinoMobile: +33 6 82 05 55 18
@Tangerino The token it's for testing. Thanks for the advice.