Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:27:15+00:00 2026-06-13T05:27:15+00:00

I have a question. I have a project, a domotic (home automation) system, in

  • 0

I have a question. I have a project, a domotic (home automation) system, in which I have to send some commands via interface to some sensors, temperature sensors, power sensors, contact sensors, etc.

I’ve already done the part in wich I can send the on/off/toggle command to a ZigBee sensor. I’ve followed this manual and this command is described at page 196.

I have this part in python in my project to set the right packet to send to the sensor:

if command not in ['ON', 'OFF', 'TOGGLE']:
        raise tornado.web.HTTPError(404, "Unknown command: " + str(command))

    op_group = "70"
    op_code = "50"
    # *9999999999999999;70;50;;100260EB008060008000000D8#
    #                   70 50  100231AC00000000000008060008000101A9
    packet_meta = "*%s;%s;%s;%s;02%s%s600080000%s#"  # D8 i s the CRC who compute that?
    pkt_len = hextransform(16, 2)

    # Hexify the network ID
    netid = hextransform(int(nid), 16)
    # Hexify the sensor ID
    # TODO: - split sensor_id in ZTC sensor_id and endpoint!
    #       - ZTC sens ID is 2 bytes 
    #       - ZTC endpoint is 1 byte
#        sens_id = hextransform(int(sid) >> 8, 4)
#        end_point = hextransform(int(sid) & 0x0000FF, 2)


#        print("\nsens_id: '" + sens_id + "'\n")
#        print("\nendpoint: '" + end_point + "'\n")

    # TODO: - split sensor_id in ZTC sensor_id and clusterid!
    #       - ZTC sens ID is 2 bytes 
    #       - ZTC clusterid is 2 bytes
    sens_id = hextransform(int(sid) >> 16, 4)#elisa
    sens_id_little = invert2bytes(sens_id,0)
    cluster_id = hextransform(int(sid) & 0x00FFFF, 4)#elisa
    end_point = "08" #elisa

    if command == 'ON':
        cmd_data = "01"
    elif command == 'OFF':
        cmd_data = "00"
    elif command == 'TOGGLE':
        cmd_data = "02"

    packet = packet_meta % (netid, op_group, op_code, pkt_len, sens_id, end_point, cmd_data)
    packet = packet.upper()
    print("\t\t " + packet + "\n")

    ################ ELISA #########################################
    cmd_meta = "02%s000000000000080600080000%s" #elisa
    mycommand = cmd_meta % (sens_id_little, cmd_data) #elisa
    len_mycommand = len(mycommand)/2
    op_group_hex=0x70
    op_code_hex=0x50
    mynet_type ="ztc"

    cmdjson = packet2json(op_group_hex,op_code_hex, mycommand)
    #
    #
    #TODO : -write command into db  
    ts = datetime.datetime.now().isoformat()
    self.lock_tables("write", ['confcommands'])
self.db.execute("INSERT INTO confcommands (network_id, ntype, timestamp, command) \
                              VALUES (%s,%s,%s,%s)", nid, mynet_type, ts, cmdjson)
    self.unlock_tables();

Now, following the manual, I would add the restart command, to restarting the sensor. And then also add the restore startup configuration command.

So I don’t know where are these commands in the manual. There are several of them. Then, I don’t see e clearly value for the command restart or restore startup configuration. If for the on/off/toggle there are three values (00, 01, 02), in this case the manual don’t say what’s the value to assign to cmd_data variable for create the right packet to send to the sensor.

I hope you can help me, because I don’t know anymore where search for this. Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:27:17+00:00Added an answer on June 13, 2026 at 5:27 am

    I do not know the ZigBee techno, but according to your documentation you can try to send the APS messages called APSME-RESET.Request and APSME-REST.Confirm for plateform reset or NLME-Reset.Request and NLME-Reset.Confirm for network manager reset

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question I have a project asp.net mvc which is developed in
i have a question about the theory here, i'm just starting a project which
I have some question related to project building in Java . When attempting to
I have a question with this project https://github.com/sephiroth74/AndroidWheel .. I have found more questions
I have a question. Now in project we use git for automatically update testing
I have a question about symfony2. I have a project and I am using
I am doing project euler question 33 and have divised a refactor to solve
I have a short question. Im my current project I'm using LINQ-to-SQl. That is
I'm working for a university project, and I have the following question: I have
I've just imported a Flex component into my project. I have a theory question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.